diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c627470 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/bin +/lib/* +!/lib/dependencies.txt +/target diff --git a/README.md b/README.md new file mode 100644 index 0000000..dad0ad5 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +CreateSRG +========= + +### Building +You can build with Ant or Maven; they are mutually compatible. +The ant build script is very simple but requires you manually retrieve dependencies. +The maven build automatically downloads dependencies from the central repository. +Both place the resulting jars in `target/`. + +##### Ant +- Download the necessary jars, listed in `lib/dependencies.txt` +- Run `ant` + +##### Maven +- Run `mvn package` diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..dde2aec --- /dev/null +++ b/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/dependencies.txt b/lib/dependencies.txt new file mode 100644 index 0000000..da2ec39 --- /dev/null +++ b/lib/dependencies.txt @@ -0,0 +1,7 @@ +### Dependencies +- Google guava +- ObjectWeb asm +- GNU trove + +### Other notes +- Make sure to compile trove; the jar in the download I found only included the sources diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f82c16a --- /dev/null +++ b/pom.xml @@ -0,0 +1,90 @@ + + 4.0.0 + + immibis.bon + create-srg + 0.1.0 + jar + + create-srg + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + net.sf.trove4j + trove4j + 3.0.3 + + + org.ow2.asm + asm-commons + 4.2 + + + org.ow2.asm + asm-tree + 4.2 + + + com.google.guava + guava + 15.0 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.4 + + + + Main + + + + jar-with-dependencies + + + + + package + + single + + + + + + + + src/main/java + + 1.7.2.txt + + + + + diff --git a/src/1.7.2.txt b/src/main/java/1.7.2.txt similarity index 100% rename from src/1.7.2.txt rename to src/main/java/1.7.2.txt diff --git a/src/FieldNameGenerator.java b/src/main/java/FieldNameGenerator.java similarity index 100% rename from src/FieldNameGenerator.java rename to src/main/java/FieldNameGenerator.java diff --git a/src/Main.java b/src/main/java/Main.java similarity index 99% rename from src/Main.java rename to src/main/java/Main.java index 0b7eb24..14e0c2a 100644 --- a/src/Main.java +++ b/src/main/java/Main.java @@ -570,7 +570,7 @@ private static void getExceptions(URLClassLoader loader, MethodIdentifier method // exception table entries are generated for a single catch block? Map tryCatchData = new HashMap<>(); - for(TryCatchBlockNode tcbn : mn.tryCatchBlocks) { + for(TryCatchBlockNode tcbn : (List) mn.tryCatchBlocks) { if(tcbn.type == null) continue; // ignore finally blocks if(tryCatchData.containsKey(tcbn.handler)) @@ -589,11 +589,11 @@ private static void getExceptions(URLClassLoader loader, MethodIdentifier method } analyzer.visitCode(); - for(TryCatchBlockNode tcbn : mn.tryCatchBlocks) + for(TryCatchBlockNode tcbn : (List) mn.tryCatchBlocks) tcbn.accept(analyzer); analyzer.visitMaxs(mn.maxStack, mn.maxLocals); if(mn.localVariables != null) - for(LocalVariableNode lvn : mn.localVariables) + for(LocalVariableNode lvn : (List) mn.localVariables) lvn.accept(analyzer); for(AbstractInsnNode in = mn.instructions.getFirst(); in != null; in = in.getNext()) { diff --git a/src/MethodIdentifier.java b/src/main/java/MethodIdentifier.java similarity index 100% rename from src/MethodIdentifier.java rename to src/main/java/MethodIdentifier.java diff --git a/src/MethodNameGenerator.java b/src/main/java/MethodNameGenerator.java similarity index 100% rename from src/MethodNameGenerator.java rename to src/main/java/MethodNameGenerator.java diff --git a/src/main/java/immibis/bon/App.java b/src/main/java/immibis/bon/App.java new file mode 100644 index 0000000..f07e9e6 --- /dev/null +++ b/src/main/java/immibis/bon/App.java @@ -0,0 +1,13 @@ +package immibis.bon; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/test/java/immibis/bon/AppTest.java b/src/test/java/immibis/bon/AppTest.java new file mode 100644 index 0000000..909106d --- /dev/null +++ b/src/test/java/immibis/bon/AppTest.java @@ -0,0 +1,38 @@ +package immibis.bon; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}