tunnelvisionlabs / antlr4

The highly-optimized fork of ANTLR 4 (see README)
Other
73 stars 12 forks source link

feat: jpms support #86

Open sgammon opened 6 months ago

sgammon commented 6 months ago

Summary

This changeset introduces support for the Java Platform Module System, or JPMS, within the ANTLR v4 runtime and annotations packages.

The runtime package can now be depended on in downstream modules with a requires antlr.runtime directive.

To facilitate this functionality, a breaking change had to be made with regard to packages used for annotations. The following package changes were made:

Code generators, service definitions, and other references to these classes were updated accordingly. This change was made to fix split package issues between the ANTLR runtime and annotations modules, which is banned under JPMS.

The JVM target was updated to JVM 11, which allows cleanup of older JDK 1.6 and JDK 1.8 related build wiring. Reasoning: users of 1.6 and 1.8 do not need libs that support JPMS; building multi-release JARs in Maven is hard and error-prone. There isn't much sense in setting a JVM target of 9 or 10, so 11 is the new standard.

Additionally, the codebase now uses a bootstrap JAR to facilitate code-gen in antlr4-runtime; this bootstrap JAR is located in the lib/ folder and automatically installed for the developer if they use either ./mvnw (also added) or ./bootstrap.sh.

This bootstrap JAR will allow iteration on the code generator without needing to release a new plugin version.

Changelog

cc / @sharwell

sgammon commented 6 months ago

related: antlr/antlr4#2946, antlr/antlr4#4383, antlr/antlr4#4137, apple/pkl#42, apple/pkl#187