-
Notifications
You must be signed in to change notification settings - Fork 3.4k
ANTLR as a named Java module #2946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are there any updates on this issue? |
Hi,
as you know, ANTLR is Java 8 compatible, when module support was introduced with Java 9.
If you can find a way to make it look like a Java 9 module without breaking Java 8 compatibility we’ll definitely look into it.
Eric
… Le 15 févr. 2022 à 18:36, Thiago Henrique Hüpner ***@***.***> a écrit :
Are there any updates on this issue?
—
Reply to this email directly, view it on GitHub <#2946 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAZNQJAUSH3437UWSDDEH53U3KFLHANCNFSM4TA7RUTQ>.
You are receiving this because you are subscribed to this thread.
|
Hi @ericvergnaud! Thanks for the update :) There are a couple of ways to add the module-info to the project without breaking changes. However, the build itself will require at least Java 11. With that said,
This way, the module-info will be at the root of the Jar file. While most of the time it is just fine, some old build tools that don't recognize it yet may break. So maybe you would check the Multi-release Jar (https://openjdk.java.net/jeps/238), and put it in the META-INF/versions/11/module-info.class. |
Hi, please submit a PR, that's the way we operate :-) |
PR submitted, the approach is similar to slf4j's https://github.com/qos-ch/slf4j/blob/master/pom.xml. <!-- runtime-testsuite's pom.xml-->
<configuration>
<release>8</release>
<source>9</source>
<target>9</target>
</configuration> |
I'm not familiar with the module stuff I'm afraid. can we be sure this won't break my simple java 8 world? |
Hi, I am a Java package maintainer, I have seen a few approaches:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>antlr4.runtime</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build> |
Hi, unfortunately the latter approach is not fully compatible with java module system, e.g. |
I noticed the linked PR after submitting the comment, that is definitely a way to go. |
Since bnd is already in use, would it make sense to use it to generate the module-info? |
Hi there,
it is planned to release ANTLR4 as a named module for Java? Currently the ANTLR runtime does not have a "module-info.class". This causes problems when using it with "jlink". As we have Java 15 now and modules can/should be used since Java 9 it would be great to convert ANTLR into a named module too.
Sure, I could inject a "module-info.java" myself with "jdeps --generate-module-info" and "javac --patch-module", but this does not feel right. And it creates new problems if the jar is provided by Maven...
The text was updated successfully, but these errors were encountered: