Skip to content
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

feat: jpms support #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sgammon
Copy link

@sgammon sgammon commented Mar 1, 2024

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:

  • o.a.v.misc.NotNullorg.antlr.v4.annotations.NotNull
  • o.a.v.misc.Nullableorg.antlr.v4.annotations.Nullable
  • o.a.v.r.NullUsageProcessor...processors.NullUsageProcessor

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

  • feat: add module-info.java descriptor
  • fix!: update annotation package path to o.a.v.annotations.*
  • chore: upgrade jvm target → 11
  • chore: upgrade all maven plugins to latest
  • chore: centralize maven plugin versions
  • chore: centralize dependency versions
  • chore: refactor build to fix dependency on old plugin version

cc / @sharwell

- feat: add `module-info.java` descriptor
- fix!: update annotation package path to `o.a.v.annotations.*`
- chore: upgrade jvm target → `11`
- chore: upgrade all maven plugins to latest
- chore: centralize maven plugin versions
- chore: centralize dependency versions
- chore: refactor build to fix dependency on old plugin version

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:

- `o.a.v.misc.NotNull` → `org.antlr.v4.annotations.NotNull`
- `o.a.v.misc.Nullable` → `org.antlr.v4.annotations.Nullable`
- `o.a.v.r.NullUsageProcessor` → `...processors.NullUsageProcessor`

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.

Signed-off-by: Sam Gammon <sam@elide.ventures>
@sgammon
Copy link
Author

sgammon commented Mar 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant