From 187ecfe00d3c1f0210d3b73cd0c2ce9f8bc3248a Mon Sep 17 00:00:00 2001 From: Raekye Date: Wed, 20 Nov 2013 13:33:45 -0500 Subject: [PATCH 1/4] ant build --- .gitignore | 4 ++++ build.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ lib/dependencies.txt | 7 +++++++ src/Main.java | 6 +++--- 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 build.xml create mode 100644 lib/dependencies.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3541d7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/bin +/dist +/lib/* +!/lib/dependencies.txt diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..8ba70ee --- /dev/null +++ b/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/dependencies.txt b/lib/dependencies.txt new file mode 100644 index 0000000..4932618 --- /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 included in the zip only has the sources diff --git a/src/Main.java b/src/Main.java index 0b7eb24..14e0c2a 100644 --- a/src/Main.java +++ b/src/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()) { From b1ee36e6a135a2eda40169ed4ab2ec805c8da67b Mon Sep 17 00:00:00 2001 From: Raekye Date: Wed, 20 Nov 2013 14:05:55 -0500 Subject: [PATCH 2/4] mavenified for easy dependency management. ant also works --- .gitignore | 2 +- build.xml | 8 +- lib/dependencies.txt | 2 +- pom.xml | 82 ++++++++++++++++++++ src/{ => main/java}/1.7.2.txt | 0 src/{ => main/java}/FieldNameGenerator.java | 0 src/{ => main/java}/Main.java | 0 src/{ => main/java}/MethodIdentifier.java | 0 src/{ => main/java}/MethodNameGenerator.java | 0 src/main/java/immibis/bon/App.java | 13 ++++ src/test/java/immibis/bon/AppTest.java | 38 +++++++++ 11 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 pom.xml rename src/{ => main/java}/1.7.2.txt (100%) rename src/{ => main/java}/FieldNameGenerator.java (100%) rename src/{ => main/java}/Main.java (100%) rename src/{ => main/java}/MethodIdentifier.java (100%) rename src/{ => main/java}/MethodNameGenerator.java (100%) create mode 100644 src/main/java/immibis/bon/App.java create mode 100644 src/test/java/immibis/bon/AppTest.java diff --git a/.gitignore b/.gitignore index 3541d7e..c627470 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /bin -/dist /lib/* !/lib/dependencies.txt +/target diff --git a/build.xml b/build.xml index 8ba70ee..d7e5dbe 100644 --- a/build.xml +++ b/build.xml @@ -1,8 +1,8 @@ - + - + @@ -15,7 +15,7 @@ - + @@ -40,4 +40,4 @@ - \ No newline at end of file + diff --git a/lib/dependencies.txt b/lib/dependencies.txt index 4932618..da2ec39 100644 --- a/lib/dependencies.txt +++ b/lib/dependencies.txt @@ -4,4 +4,4 @@ - GNU trove ### Other notes -- Make sure to compile trove; the jar included in the zip only has the sources +- 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..f6afe21 --- /dev/null +++ b/pom.xml @@ -0,0 +1,82 @@ + + 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 + + + + + + + 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 100% rename from src/Main.java rename to src/main/java/Main.java 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 ); + } +} From 3c509e3260f6fce84c28575a15371c2c0da99173 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 20 Nov 2013 14:08:32 -0500 Subject: [PATCH 3/4] Create README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 README.md 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` From 720d5a4739163cb8204335a5fdbfa6715dd520b9 Mon Sep 17 00:00:00 2001 From: Raekye Date: Wed, 20 Nov 2013 22:49:34 -0500 Subject: [PATCH 4/4] fixed including version mappings file --- build.xml | 1 + pom.xml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/build.xml b/build.xml index d7e5dbe..dde2aec 100644 --- a/build.xml +++ b/build.xml @@ -35,6 +35,7 @@ + diff --git a/pom.xml b/pom.xml index f6afe21..f82c16a 100644 --- a/pom.xml +++ b/pom.xml @@ -78,5 +78,13 @@ + + + src/main/java + + 1.7.2.txt + + +