From 8b8b96cf7d228b92403b39494125538c006dd9ef Mon Sep 17 00:00:00 2001 From: Alexander Berdnik Date: Thu, 23 Feb 2023 22:37:28 +0000 Subject: [PATCH 1/3] java runtime: add module-info.java and multi-release build to support java modules on java 9+ Signed-off-by: Alexander Berdnik --- runtime/Java/pom.xml | 32 ++++++++++++++++++++++++++---- runtime/Java/src9/module-info.java | 7 +++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 runtime/Java/src9/module-info.java diff --git a/runtime/Java/pom.xml b/runtime/Java/pom.xml index fe646bf5e3..571137b09d 100644 --- a/runtime/Java/pom.xml +++ b/runtime/Java/pom.xml @@ -83,7 +83,6 @@ process-classes - org.antlr.antlr4.runtime org.antlr.antlr4-runtime org.antlr.v4.gui;resolution:=optional, * @@ -110,10 +109,35 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 + + + default-compile + + compile + + + 1.8 + 1.8 + + + + + module-compile + compile + + compile + + + 9 + + ${project.basedir}/src9 + + true + + + - 8 - 1.8 - 1.8 + diff --git a/runtime/Java/src9/module-info.java b/runtime/Java/src9/module-info.java new file mode 100644 index 0000000000..82011ea6cb --- /dev/null +++ b/runtime/Java/src9/module-info.java @@ -0,0 +1,7 @@ +module org.antlr.antlr.runtime { + exports org.antlr.v4.runtime; + exports org.antlr.v4.runtime.atn; + exports org.antlr.v4.runtime.dfa; + exports org.antlr.v4.runtime.misc; + exports org.antlr.v4.runtime.tree; +} From fc83811b25f95963d068f94f2d975e627c623ced Mon Sep 17 00:00:00 2001 From: Alexander Berdnik Date: Mon, 6 Mar 2023 19:39:09 +0000 Subject: [PATCH 2/3] java runtime: add multi-release entry to the manifest file Signed-off-by: Alexander Berdnik --- runtime/Java/pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/Java/pom.xml b/runtime/Java/pom.xml index 571137b09d..f9404fcfb7 100644 --- a/runtime/Java/pom.xml +++ b/runtime/Java/pom.xml @@ -101,6 +101,9 @@ true + + true + ${project.build.outputDirectory}/META-INF/MANIFEST.MF From dffdf0be986e7162ed2e0a038af128d9dfc9be50 Mon Sep 17 00:00:00 2001 From: Alexander Berdnik Date: Mon, 6 Mar 2023 19:50:16 +0000 Subject: [PATCH 3/3] use release option for java 8 build Signed-off-by: Alexander Berdnik --- runtime/Java/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/Java/pom.xml b/runtime/Java/pom.xml index f9404fcfb7..8268d9e306 100644 --- a/runtime/Java/pom.xml +++ b/runtime/Java/pom.xml @@ -119,8 +119,7 @@ compile - 1.8 - 1.8 + 8