The Gradle docs: New javafx plugin

Johan Vos johan.vos at gluonhq.com
Mon Dec 3 20:04:32 UTC 2018


Hi,

Good suggestions.
I think this can be discussed in the issues of the doc site itself:

https://github.com/openjfx/openjfx-docs/issues

- Johan

On Mon, Dec 3, 2018 at 8:18 PM Sverre Moe <sverre.moe at gmail.com> wrote:

> I noticed the tutorial on building JavaFX 11 with Gradle has changed.
> https://openjfx.io/openjfx-docs/#gradle
>
> A new plugin has emerged: https://github.com/openjfx/javafx-gradle-plugin
> id 'org.openjfx.javafxplugin' version '0.0.5'
>
> javafx {
>     modules = [ 'javafx.controls' ]
> }
>
> The guide should mention how to set a specific JavaFX version to use.
> It seems the plugin has hard coded version to 11.0.1, but this can be
> changed by setting the version variable. I had to look into the source code
> to find this.
> javafx {
>     version = "11.0.+"
>
>     modules = [
>         'javafx.graphics',
>         'javafx.controls',
>         'javafx.media',
>         'javafx.web',
>         'javafx.fxml'
>     ]
> }
>
> Previously this was the setup used in the tutorial before this new plugin:
>
> buildscript {
>     repositories {
>         mavenCentral()
>     }
>     dependencies {
>         classpath group: 'com.google.gradle', name:
> 'osdetector-gradle-plugin', version: '1.6.0'
>     }
> }
>
> ext {
>     platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows'
> ? 'win' : osdetector.os
> }
>
> dependencies {
>     compile group: 'org.openjfx', name: "javafx-base", version: '11',
> classifier: platform
> }
>
> I have previously been using the moduleplugin to get module support on
> Gradle. Seems this new javafx plugin does the same thing. It work similar
> without the moduleplugin. Though the moduleplugin could be used for
> non-javafx module projects.
> id "org.javamodularity.moduleplugin" version "1.2.1"
>
> However neither of these plugins work with Javadoc task when having Log4j
> as a dependency. Same error on both:
> module-info.java:12: error: module not found: org.apache.logging.log4j
>
>
> Could it be possible to expand this new plugin later to incorporate
> JLink/JPackager for building a runtime image and installers with JavaFX.
> There is an older JavaFX plugin used for building with JavaFX 8 and package
> using javapackager.
> https://github.com/FibreFoX/javafx-gradle-plugin
>
> /Sverre
>


More information about the openjfx-discuss mailing list