Skip to content

refactoring gradle.build: Use gradle's task parallelization and caching to speedup builds#7556

Merged
karianna merged 290 commits into
PCGen:masterfrom
Vest:kar_gh_build_gradle_deps
May 18, 2026
Merged

refactoring gradle.build: Use gradle's task parallelization and caching to speedup builds#7556
karianna merged 290 commits into
PCGen:masterfrom
Vest:kar_gh_build_gradle_deps

Conversation

@Vest
Copy link
Copy Markdown
Contributor

@Vest Vest commented May 11, 2026

Summary

Migrates the PCGen build to JPMS, replaces the Xalan XSLT processor with Saxon-HE, swaps the runtime/jpackage plugin to org.beryx.jlink, rewrites the JDK download/extract for cross-platform parallel builds, and enables Gradle's configuration cache.

Java Platform Module System (JPMS) migration

  • Adds code/src/java/module-info.java declaring the pcgen module with explicit requires (java.desktop, java.xml, javafx.*, PCGen.base, PCGen.Formula, Saxon.HE, FOP, Spring, etc.)
  • Drops the deprecated jdk.jsobject module requirement.
  • IntelliJ module visibility.
  • gui3 sub-packages opened for the reflection that FXML loading requires.

XSLT processor: Xalan → Saxon-HE

  • Drops xalan:xalan and xalan:serializer from the FOP exclude block; adds net.sf.saxon:Saxon-HE:12.9.
  • Across ~200 .xslt files in outputsheets/: replaces the Xalan-specific namespace xmlns:xalan="http://xml.apache.org/xalan" with the portable EXSLT namespace xmlns:exsl="http://exslt.org/common".
  • Wraps substring-before(...) in number(...) where the result is used in arithmetic — Saxon is stricter than Xalan about string-to-number coercion in XSLT 1.0.

Runtime image: org.beryx.runtime → org.beryx.jlink

  • Master uses the legacy org.beryx.runtime plugin to drive jpackage. This branch swaps to org.beryx.jlink, which is the maintained successor and integrates with JPMS module graphs.
  • macOS app bundle: working directory set correctly via the MacDirLauncher script swap, gui3 packages opened for reflection.

Cross-platform JDK download

  • Rewrote JDK download/extract as per-platform parallel tasks.
    The old downloadJRE / downloadJavaFXModules used imperative doLast blocks that were incompatible with the configuration cache, and extractJDKs was effectively broken (its checks ran at configuration time and always reported NO-SOURCE). The replacement is declarative Download + Copy tasks per platform with proper up-to-date checks.
  • Output directory renamed jre/jdks/ to reflect that we now pull full JDKs (jlink and jpackage need javac and the jmods directory, not a stripped JRE).
  • targetPlatform(...) registration now host-aware: only registers the current host's platform unless PCGEN_ALL_PLATFORMS=true is set (CI uses platform-specific runners and sets this on each).

JavaFX dependency wiring

  • Removed the org.openjfx.javafxplugin because it duplicated the manual setup.

Gradle configuration cache

  • org.gradle.configuration-cache flipped from false to true (parallel, warn-on-problem mode).

Misc

  • Spring updated to 7.0.7 (web, beans, core).
  • AGENTS.md updated to reflect the new build script structure.
  • Checkstyle: module-info.java excluded from checks (the syntax isn't recognized by the project's checkstyle config);
  • Cosmetic build.gradle cleanup: removed the unused defaultTasks declaration.

dependabot Bot and others added 30 commits July 16, 2023 10:39
Bumps [org.springframework:spring-core](https://github.com/spring-projects/spring-framework) from 6.0.10 to 6.0.11.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v6.0.10...v6.0.11)

---
updated-dependencies:
- dependency-name: org.springframework:spring-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Goldielocks has incorrect value displayed for darkvision in the ability.

* NEWSOURCE-424
Starfinder Near Space request
* Goldielocks has incorrect value displayed for darkvision in the ability.

* NEWSOURCE-435
Request for Vanguard (Path of Iron - Ascension Games)
…en#6902)

Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.9.3 to 5.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit-framework@r5.9.3...r5.10.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…CGen#6906)

Bumps [org.junit.platform:junit-platform-runner](https://github.com/junit-team/junit5) from 1.9.3 to 1.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/commits)

---
updated-dependencies:
- dependency-name: org.junit.platform:junit-platform-runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…6905)

Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.9.3 to 5.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit-framework@r5.9.3...r5.10.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…en#6903)

Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.3 to 5.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit-framework@r5.9.3...r5.10.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…CGen#6904)

Bumps [org.junit.platform:junit-platform-launcher](https://github.com/junit-team/junit5) from 1.9.3 to 1.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/commits)

---
updated-dependencies:
- dependency-name: org.junit.platform:junit-platform-launcher
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps org.apache.commons:commons-lang3 from 3.12.0 to 3.13.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps edu.sc.seis.launch4j from 3.0.3 to 3.0.4.

---
updated-dependencies:
- dependency-name: edu.sc.seis.launch4j
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps com.github.spotbugs from 5.0.14 to 5.1.0.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps com.github.spotbugs from 5.1.0 to 5.1.1.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.github.spotbugs from 5.1.1 to 5.1.2.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps com.github.spotbugs from 5.1.2 to 5.1.3.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps org.apache.xmlgraphics:fop from 2.8 to 2.9.

---
updated-dependencies:
- dependency-name: org.apache.xmlgraphics:fop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
karianna and others added 9 commits February 7, 2026 11:18
Signed-off-by: Vest <Vest@users.noreply.github.com>
# Conflicts:
#	.github/workflows/gradle-release.yml
#	AGENTS.md
#	build.gradle
#	code/src/utest/pcgen/persistence/lst/URIFactoryTest.java
#	gradle.properties
Signed-off-by: Vest <Vest@users.noreply.github.com>
…-compilation

The previous downloadJRE/downloadJavaFXModules tasks used imperative doLast logic incompatible with the configuration cache, and extractJDKs was broken (ran checks at configuration time, always reported NO-SOURCE).
Replace with declarative per-platform Download and Copy tasks that run in parallel, support proper up-to-date checks, and are configuration-cache compatible. The runtime plugin now references jdks/ instead of jre/.

Removed default task - build.

Signed-off-by: Vest <Vest@users.noreply.github.com>
Comment thread gradlew.bat
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated Gradle to 9.5.0

Vest added 15 commits May 12, 2026 07:16
Xalan 2.x is effectively unmaintained and causes module-system friction
in jlink builds. Saxon-HE 12.7 is the modern replacement and registers
the same javax.xml.transform.TransformerFactory SPI.

- Remove xalan:xalan and xalan:serializer dependencies; exclude them
  from FOP's transitive graph so they cannot re-enter
- Add net.sf.saxon:Saxon-HE:12.7
- Explicitly name Saxon's TransformerFactoryImpl in FopTask rather than
  relying on classpath SPI ordering
- Replace org.apache.xml.utils.XMLChar.isValid() in AbstractToken with
  an inline XML 1.0 §2.2 character validity check, eliminating the last
  direct reference to the Xalan serializer jar
- Update jlink forceMerge and drop the now-unnecessary
  excludeProvides for org.apache.xalan.extensions.bsf.BSFManager
- Replace xalan:nodeset() with exsl:node-set() and update namespace
  declarations across 171 output sheet XSLT files for Saxon compatibility
…tion

The badass-jlink-plugin (org.beryx.jlink) replaces org.beryx.runtime
which is incompatible with Gradle 9's configuration cache. These
supporting changes complete the migration:

- Add module-info.java declaring the pcgen module with its requires,
  exports, and opens directives for JPMS compliance
- Update distribution.gradle: replace runtimeZip with jlinkZip, fix
  installDist to avoid config-cache-unsafe delete{} block
- Update release.gradle: replace runtimeZip with jlinkZip, reference
  fullJpackage task for Mac/Linux artifact assembly
Fixes 'Expression should be of type number' warnings by making the
string-to-number conversion explicit in all outputsheet XSL files.
- MacDirLauncher: cd to Contents/app so PCGen finds data/plugins/preview/
  outputsheets, invoke PcGen binary via absolute path
- module-info.java: open pcgen.gui3.* packages for JavaFX FXML reflection
- assembleJpackageImage: always re-copy since jpackageImage wipes the
  output directory on rebuild
IntelliJ enforces module boundaries strictly unlike the Gradle build
which uses --patch-module to merge dependencies into the pcgen module.
Fixes stale task names, plugin versions, and tool versions that drifted
as build.gradle evolved (cleanJre→cleanJdks, JUnit 5→6, Checkstyle
12→13, SpotBugs plugin 6.4→6.5, PMD version added, jpackage→fullJpackage,
download task names corrected, jlink plugin version noted).
jdk.jsobject was deprecated for removal in Java 22 (JEP 471). JavaFX 22+
bundles its own JSObject support in javafx.web, so the explicit JDK
module dependency is no longer needed.
Move classes out of packages shared with PCGen-base/PCGen-Formula jars
so that those jars can live on --module-path as proper modules instead
of being merged via --patch-module:

- pcgen.base.util.{NamedFormula,ProxyUtilities,RandomUtil,WeightedCollection} → pcgen.util
- pcgen.base.format.HandedManager → pcgen.format

This eliminates the split-package violation that prevented javac from
seeing PCGen.base and PCGen.Formula as separate modules during
compilation, allowing the requires directives in module-info.java to
work with both Gradle and IntelliJ.
- Remove fat jar: dependencies are now separate jars handled by jlink's
  forceMerge rather than bundled into pcgen.jar
- Add xmlresolver to forceMerge to resolve package export conflict
- Replace --patch-module with --module-path for compileJava: all
  dependencies are now visible as proper modules
- Add requires directives for all runtime dependencies in module-info.java
  so the compiler can resolve them on the module-path
- Remove --patch-module hack from compileJava, place all dependencies on
  --module-path so IntelliJ and Gradle use the same module resolution
- Add requires directives to module-info.java for all runtime deps
  (commons-lang3, commons-io, fop-core, fop-events, xmlgraphics-commons,
  spring, freemarker, jdom2, argparse4j, controlsfx, xmlunit, Saxon, jep)
- Open additional packages to Spring for reflective bean instantiation
- Add sourceSets.test.output to itest/slowtest compile classpaths so
  IntelliJ maps the test module dependency at Compile scope, not Runtime
The plugin was causing configuration cache warnings (SourceSetContainer
serialization). JavaFX modules are already managed manually via
downloadJavaFXLocal/extractJavaFXLocal tasks and explicit --module-path
args. The jlink task now depends on downloadJavaFXMods directly to get
JavaFX jmods into the target JDK.
Without the javafxplugin, IntelliJ can't find javafx.controls etc.
Adding the local mods/lib jars as implementation dependencies makes
them visible to the IDE while Gradle still uses --module-path.
…issues

- Exclude module-info.java from Checkstyle (it uses syntax Checkstyle can't parse)
- Remove redundant same-package import in RandomUtil.java
- Fix incorrect @param tag in AbstractToken.isValidXMLChar()
@Vest
Copy link
Copy Markdown
Contributor Author

Vest commented May 17, 2026

Unfortunately several hundreds XSLT files were modified, because I have removed xalan from dependencies: 54f893d

It doesn't bring much into the project, but adds a legacy headache.

@Vest Vest marked this pull request as ready for review May 17, 2026 20:54
@karianna karianna merged commit 0da501f into PCGen:master May 18, 2026
3 checks passed
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.

6 participants