From f47967577dd1a05cc2b48de64295dc899e2c32ca Mon Sep 17 00:00:00 2001 From: Thibaud Date: Tue, 23 Oct 2018 20:40:10 +0200 Subject: [PATCH 1/3] Fix parent name in parser/pom.xml --- parser/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/pom.xml b/parser/pom.xml index 16d5de0..a1b7e7a 100644 --- a/parser/pom.xml +++ b/parser/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - compiler + antlr-compiler org.example 1.0-SNAPSHOT From 11f227e2035160c65b8cbdbc167c75acfd561775 Mon Sep 17 00:00:00 2001 From: Thibaud Date: Tue, 23 Oct 2018 20:43:00 +0200 Subject: [PATCH 2/3] Change test-resources path to src/test/resources --- .../test/java/de/letsbuildacompiler/compiler/CompilerTest.java | 2 +- .../{test-resources => resources}/examples/branch/if_int_false | 0 .../{test-resources => resources}/examples/branch/if_int_true | 0 .../examples/functions/int_parameters | 0 .../{test-resources => resources}/examples/functions/scopes | 0 .../examples/functions/simple_function | 0 .../examples/operators/and-skip-right | 0 .../examples/operators/or-skip-right | 0 8 files changed, 1 insertion(+), 1 deletion(-) rename compiler/src/test/{test-resources => resources}/examples/branch/if_int_false (100%) rename compiler/src/test/{test-resources => resources}/examples/branch/if_int_true (100%) rename compiler/src/test/{test-resources => resources}/examples/functions/int_parameters (100%) rename compiler/src/test/{test-resources => resources}/examples/functions/scopes (100%) rename compiler/src/test/{test-resources => resources}/examples/functions/simple_function (100%) rename compiler/src/test/{test-resources => resources}/examples/operators/and-skip-right (100%) rename compiler/src/test/{test-resources => resources}/examples/operators/or-skip-right (100%) diff --git a/compiler/src/test/java/de/letsbuildacompiler/compiler/CompilerTest.java b/compiler/src/test/java/de/letsbuildacompiler/compiler/CompilerTest.java index 8a8d03c..971a3e9 100644 --- a/compiler/src/test/java/de/letsbuildacompiler/compiler/CompilerTest.java +++ b/compiler/src/test/java/de/letsbuildacompiler/compiler/CompilerTest.java @@ -159,7 +159,7 @@ public class CompilerTest { } private String[] example(String name, String expectedResult) throws IllegalArgumentException { - try (InputStream in = CompilerTest.class.getClassLoader().getResourceAsStream("examples/" + name)) { + try (InputStream in = getClass().getResourceAsStream("/examples/" + name)) { if (in == null) { throw new IllegalArgumentException("No such example " + name); } diff --git a/compiler/src/test/test-resources/examples/branch/if_int_false b/compiler/src/test/resources/examples/branch/if_int_false similarity index 100% rename from compiler/src/test/test-resources/examples/branch/if_int_false rename to compiler/src/test/resources/examples/branch/if_int_false diff --git a/compiler/src/test/test-resources/examples/branch/if_int_true b/compiler/src/test/resources/examples/branch/if_int_true similarity index 100% rename from compiler/src/test/test-resources/examples/branch/if_int_true rename to compiler/src/test/resources/examples/branch/if_int_true diff --git a/compiler/src/test/test-resources/examples/functions/int_parameters b/compiler/src/test/resources/examples/functions/int_parameters similarity index 100% rename from compiler/src/test/test-resources/examples/functions/int_parameters rename to compiler/src/test/resources/examples/functions/int_parameters diff --git a/compiler/src/test/test-resources/examples/functions/scopes b/compiler/src/test/resources/examples/functions/scopes similarity index 100% rename from compiler/src/test/test-resources/examples/functions/scopes rename to compiler/src/test/resources/examples/functions/scopes diff --git a/compiler/src/test/test-resources/examples/functions/simple_function b/compiler/src/test/resources/examples/functions/simple_function similarity index 100% rename from compiler/src/test/test-resources/examples/functions/simple_function rename to compiler/src/test/resources/examples/functions/simple_function diff --git a/compiler/src/test/test-resources/examples/operators/and-skip-right b/compiler/src/test/resources/examples/operators/and-skip-right similarity index 100% rename from compiler/src/test/test-resources/examples/operators/and-skip-right rename to compiler/src/test/resources/examples/operators/and-skip-right diff --git a/compiler/src/test/test-resources/examples/operators/or-skip-right b/compiler/src/test/resources/examples/operators/or-skip-right similarity index 100% rename from compiler/src/test/test-resources/examples/operators/or-skip-right rename to compiler/src/test/resources/examples/operators/or-skip-right From 97935e0b36e41152e1327c7f7d77da0b8154d58e Mon Sep 17 00:00:00 2001 From: Thibaud Date: Tue, 23 Oct 2018 21:19:18 +0200 Subject: [PATCH 3/3] Use a local maven repository to handle jasmin dependency Cf. https://stackoverflow.com/a/36602256 --- Readme.md | 26 +++++++++++++++++++ lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.md5 | 1 + lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.sha1 | 1 + lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom | 8 ++++++ lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.md5 | 1 + lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.sha1 | 1 + lib/net/jasmin/jasmin/maven-metadata.xml | 12 +++++++++ lib/net/jasmin/jasmin/maven-metadata.xml.md5 | 1 + lib/net/jasmin/jasmin/maven-metadata.xml.sha1 | 1 + mvn-deploy-jasmin.sh | 10 +++++++ pom.xml | 22 ++++++++++++++++ 11 files changed, 84 insertions(+) create mode 100644 lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.md5 create mode 100644 lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.sha1 create mode 100644 lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom create mode 100644 lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.md5 create mode 100644 lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.sha1 create mode 100644 lib/net/jasmin/jasmin/maven-metadata.xml create mode 100644 lib/net/jasmin/jasmin/maven-metadata.xml.md5 create mode 100644 lib/net/jasmin/jasmin/maven-metadata.xml.sha1 create mode 100644 mvn-deploy-jasmin.sh diff --git a/Readme.md b/Readme.md index a335acc..010d13f 100644 --- a/Readme.md +++ b/Readme.md @@ -11,3 +11,29 @@ Summary of tools used : Test cases are available [here](src/master/compiler/src/test/test-resources/examples) From [this playlist](https://www.youtube.com/watch?v=2uvKTmfPNzE&list=PLOfFbVTfT2vbJ9qiw_6fWwBAmJAYV4iUm). + +## [Installing third-party jars in maven](https://stackoverflow.com/a/36602256) + +Define a local maven repository in folder `lib/` in pom.xml : + +```xml + + + local-maven-repo + file:./lib + + +``` + +For each external jar you want to install run : + +```bash +mvn deploy:deploy-file \ + -DgroupId=com.example \ + -DartifactId=example \ + -Dversion=1.0 \ + -Durl=file:./lib/ \ + -DrepositoryId=local-maven-repo \ + -DupdateReleaseInfo=true \ + -Dfile=/path/to/file.jar +``` diff --git a/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.md5 b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.md5 new file mode 100644 index 0000000..0c71259 --- /dev/null +++ b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.md5 @@ -0,0 +1 @@ +ce04ccd442e778812cfe4cdc0c730e9b \ No newline at end of file diff --git a/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.sha1 b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.sha1 new file mode 100644 index 0000000..b7280e2 --- /dev/null +++ b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.jar.sha1 @@ -0,0 +1 @@ +c61f93bc746eff2378d0ab68d089f9ed09f257b9 \ No newline at end of file diff --git a/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom new file mode 100644 index 0000000..479b5e5 --- /dev/null +++ b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + net.jasmin + jasmin + 2.4 + diff --git a/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.md5 b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.md5 new file mode 100644 index 0000000..f3df310 --- /dev/null +++ b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.md5 @@ -0,0 +1 @@ +620c4f9571ddea3add17d3448a2f9cb5 \ No newline at end of file diff --git a/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.sha1 b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.sha1 new file mode 100644 index 0000000..c6c790d --- /dev/null +++ b/lib/net/jasmin/jasmin/2.4/jasmin-2.4.pom.sha1 @@ -0,0 +1 @@ +a61805d8249ca32acf5f4536e8ff2b642bdc20f4 \ No newline at end of file diff --git a/lib/net/jasmin/jasmin/maven-metadata.xml b/lib/net/jasmin/jasmin/maven-metadata.xml new file mode 100644 index 0000000..59d0df8 --- /dev/null +++ b/lib/net/jasmin/jasmin/maven-metadata.xml @@ -0,0 +1,12 @@ + + + net.jasmin + jasmin + + 2.4 + + 2.4 + + 20181023190639 + + diff --git a/lib/net/jasmin/jasmin/maven-metadata.xml.md5 b/lib/net/jasmin/jasmin/maven-metadata.xml.md5 new file mode 100644 index 0000000..240a795 --- /dev/null +++ b/lib/net/jasmin/jasmin/maven-metadata.xml.md5 @@ -0,0 +1 @@ +724baa85c2239c0dd3d97fb913d44c00 \ No newline at end of file diff --git a/lib/net/jasmin/jasmin/maven-metadata.xml.sha1 b/lib/net/jasmin/jasmin/maven-metadata.xml.sha1 new file mode 100644 index 0000000..9fb0786 --- /dev/null +++ b/lib/net/jasmin/jasmin/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +906195980677661d2880101f87b7ea8a43b4e324 \ No newline at end of file diff --git a/mvn-deploy-jasmin.sh b/mvn-deploy-jasmin.sh new file mode 100644 index 0000000..f396fc2 --- /dev/null +++ b/mvn-deploy-jasmin.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +mvn deploy:deploy-file \ + -DgroupId=net.jasmin \ + -DartifactId=jasmin \ + -Dversion=2.4 \ + -Durl=file:./lib/ \ + -DrepositoryId=local-maven-repo \ + -DupdateReleaseInfo=true \ + -Dfile=./lib/jasmin.jar diff --git a/pom.xml b/pom.xml index ef5f5e4..2d6a7e6 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,14 @@ parser compiler + + + + + local-maven-repo + file:./lib/ + + @@ -25,6 +33,20 @@ antlr4 4.7.1 + + + + org.testng + testng + 6.14.3 + test + + + + net.jasmin + jasmin + 2.4 + \ No newline at end of file