Skip to content

build: Modernise JVM build to align with apex-parser 5.x#7

Closed
kjonescertinia wants to merge 2 commits into
mainfrom
6-modernise-jvm-build
Closed

build: Modernise JVM build to align with apex-parser 5.x#7
kjonescertinia wants to merge 2 commits into
mainfrom
6-modernise-jvm-build

Conversation

@kjonescertinia

Copy link
Copy Markdown
Contributor

Summary

  • Replaces antlr4-maven-plugin with exec-maven-plugin + build-helper-maven-plugin running ANTLR 4.13.2 directly. The JVM and (eventually) npm sides will share a single generator pointed at /antlr, removing the per-target .g4 copy step.
  • Bumps ANTLR runtime 4.9.1 → 4.13.2 to match apex-parser 5.x and unblock downstream apex-ls, which currently sees conflicting ANTLR runtimes.
  • Maven plugins, JUnit (5.1.0 → 5.14.3), and Java toolchain (<source>1.8</source>/<target>1.8</target><release>8</release>) all brought current.
  • Switches publishing from the legacy nexus-staging-maven-plugin (OSSRH s01) to central-publishing-maven-plugin (Sonatype Central Portal).
  • CI JDK bumped 8 → 11 (required by <release>8</release>); PublishMaven.yml server-id bumped ossrhcentral to match the new plugin.

This is the first PR in the modernisation tracked in #6 — JVM-only, npm side stays on antlr4ts and is unchanged here.

Test plan

  • mvn clean package from jvm/ — green, 2/2 tests pass, jar+sources+javadoc all built locally
  • npm run init-jvm — generates VFLexer.java/VFParser.java/listeners/visitors into target/generated-sources/antlr/com/nawforce/vfparser/
  • CI Build workflow green
  • Wire-up check: apex-ls builds against this snapshot once published (separate from this PR)

Notes for the next release

  • MAVEN_USERNAME/MAVEN_TOKEN GH secrets must be a Sonatype Central Portal user token, not the legacy OSSRH one. Worth confirming before the next release fires.
  • OSSRH_GPG_SECRET_KEY secret name still works with the new plugin; left as-is to avoid touching secret config in this PR.
  • Version stays at 1.1.0 in the pom; bump at release time. Sonatype Central won't accept republishing 1.1.0, so the next deploy needs a version bump regardless.

Replace antlr4-maven-plugin with exec-maven-plugin + build-helper-maven-plugin
running ANTLR 4.13.2 directly, so the JVM and (eventually) npm sides share a
single generator. ANTLR runtime bumped 4.9.1 -> 4.13.2 to match apex-parser
and unblock downstream apex-ls.

Maven plugins, JUnit, and Java toolchain all brought current; publishing
switched from the legacy nexus-staging-maven-plugin (OSSRH s01) to
central-publishing-maven-plugin (Sonatype Central Portal). CI Java bumped
8 -> 11 since <release>8</release> requires JDK 9+ to compile.

Refs #6
@kjonescertinia kjonescertinia requested a review from nawforce April 25, 2026 20:37
ANTLR copies @lexer::members and @parser::members blocks verbatim into
generated sources, so the existing Java clearCache() helper breaks the
TypeScript target. Split each grammar into a language-neutral base file
and a per-target overlay (mirroring apex-parser):

- /antlr/BaseVF{Lexer,Parser}.g4: shared rules, no embedded actions
- /jvm/antlr/VF{Lexer,Parser}.g4: thin overlays adding the Java helper
  via @members and importing the base

The npm side will add its own (action-free) overlays in a follow-up.
clearCache() still appears on both VFLexer and VFParser on the JVM side,
preserving the apex-ls API surface.

Refs #6
@kjonescertinia

Copy link
Copy Markdown
Contributor Author

Superseded by #8 — JVM and npm modernisation combined into a single PR since the grammar split has no value without the npm overlay that consumes it, and CI runs both halves.

@kjonescertinia kjonescertinia deleted the 6-modernise-jvm-build branch April 25, 2026 21:36
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