An attempt to use
Gradle's built-in Java Platform Module System support
and a ComponentMetadataRule
for JavaFX dependency configuration. This would be an alternative to the
current JavaFX Gradle Plugin
approach.
There are several issues with the JavaFX Gradle Plugin in its current state:
- It does not currently support resolving dependencies for platforms other than the current OS (except via a workaround), which is needed to build distributions for platforms other than the build OS.
- It does not support declaring the Gradle dependency configurations (e.g. "api", "implementation", etc.) on a per-project, per-artifact basis, which is needed to create JavaFX library modules that convey proper transitive dependency information.
- It arguably overreaches in its manipulation of the module path and classpath (openjfx/javafx-gradle-plugin#133).
- It doesn't currently support the Kotlin Gradle Plugin 1.7+ (openjfx/javafx-gradle-plugin#138).
- A cacheable
ComponentMetadataRule
may prove to be a more performant way to resolve JavaFX dependencies (TBD).
See the javafx-project.gradle.kts precompiled script plugin for the crux of the configuration.
Google's OS Detector Plugin for Gradle is used for determining the current OS and architecture.
Further development on this is currently being limited by upstream issues. My primary use case for this is a mixed Kotlin and Java Project that will require incremental migration to JPMS, and these Kotlin Gradle Plugin and IntelliJ IDEA issues are currently blocking that: