From 0f47403d0220757fed189b76e2071e25b1025cb8 Mon Sep 17 00:00:00 2001 From: Runemoro Date: Wed, 3 Jun 2020 13:39:42 -0400 Subject: Split GUI code to separate module (#242) * Split into modules * Post merge compile fixes Co-authored-by: modmuss50 --- src/test/java/cuchaz/enigma/TestSourceIndex.java | 74 ------------------------ 1 file changed, 74 deletions(-) delete mode 100644 src/test/java/cuchaz/enigma/TestSourceIndex.java (limited to 'src/test/java/cuchaz/enigma/TestSourceIndex.java') diff --git a/src/test/java/cuchaz/enigma/TestSourceIndex.java b/src/test/java/cuchaz/enigma/TestSourceIndex.java deleted file mode 100644 index b201608..0000000 --- a/src/test/java/cuchaz/enigma/TestSourceIndex.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Jeff Martin. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public - * License v3.0 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * Contributors: - * Jeff Martin - initial API and implementation - ******************************************************************************/ - -package cuchaz.enigma; - -import com.google.common.collect.Sets; -import cuchaz.enigma.analysis.ClassCache; -import cuchaz.enigma.source.*; -import cuchaz.enigma.analysis.index.JarIndex; -import cuchaz.enigma.translation.representation.entry.ClassEntry; -import org.junit.Test; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Set; - -public class TestSourceIndex { - @Test - public void indexEverything() - throws Exception { - // Figure out where Minecraft is... - final String mcDir = System.getProperty("enigma.test.minecraftdir"); - Path mcJar = null; - if (mcDir == null) { - String osname = System.getProperty("os.name").toLowerCase(); - if (osname.contains("nix") || osname.contains("nux") || osname.contains("solaris")) { - mcJar = Paths.get(System.getProperty("user.home"), ".minecraft/versions/1.8.3/1.8.3.jar"); - } else if (osname.contains("mac") || osname.contains("darwin")) { - mcJar = Paths.get(System.getProperty("user.home"), "Library/Application Support/minecraft/versions/1.8.3/1.8.3.jar"); - } else if (osname.contains("win")) { - mcJar = Paths.get(System.getenv("AppData"), ".minecraft/versions/1.8.3/1.8.3.jar"); - } - } else { - mcJar = Paths.get(mcDir, "versions/1.8.3/1.8.3.jar"); - } - - if (mcJar == null) { - throw new NullPointerException("Couldn't find jar"); - } - - Enigma enigma = Enigma.create(); - EnigmaProject project = enigma.openJar(mcJar, ProgressListener.none()); - - ClassCache classCache = project.getClassCache(); - JarIndex index = project.getJarIndex(); - - Decompiler decompiler = Decompilers.PROCYON.create(classCache, new SourceSettings(false, false)); - - // get all classes that aren't inner classes - Set classEntries = Sets.newHashSet(); - for (ClassEntry obfClassEntry : index.getEntryIndex().getClasses()) { - if (!obfClassEntry.isInnerClass()) { - classEntries.add(obfClassEntry); - } - } - - for (ClassEntry obfClassEntry : classEntries) { - try { - Source source = decompiler.getSource(obfClassEntry.getName()); - source.index(); - } catch (Throwable t) { - throw new Error("Unable to index " + obfClassEntry, t); - } - } - } -} -- cgit v1.2.3