openjfx / javafx-gradle-plugin

Gradle plugin that makes it easy to work with JavaFX 11+
https://openjfx.io/
BSD 3-Clause "New" or "Revised" License
359 stars 62 forks source link

Module with javafx plugin is always considered out-of-date in a fresh gradle daemon #123

Closed UrsLange closed 2 years ago

UrsLange commented 2 years ago

A Gradle module has the following configuration:

plugins {
    id 'org.openjfx.javafxplugin' version '0.0.9'
}

javafx {
    configuration = 'api'
    version = '17'
    modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.media', 'javafx.swing', 'javafx.web']
}

The module is reported as UP-TO-DATE when running assemble twice:

gradle assemble
gradle assemble

I would now expect the module to be UP-TO-DATE when stopping the Gradle Daemon between the two assemble runs:

gradle assemble
gradle --stopp
gradle assemble

However this is not the case. Strangely when ran with the --info switch, Gradle reports that the input property Classpath was changed and the module therefore needs to be rebuilt.

Task ':common-fx:compileJava' is not up-to-date because:
  Input property 'classpath' file /home/ursl/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-swing/17/8dee489b0faecf27568bfe64efdc7aa01410defa/javafx-swing-17-linux.jar has been removed.
  Input property 'classpath' file /home/ursl/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-web/17/bbd71beaf561b72f0d3eb6268d3114573b7799c3/javafx-web-17-linux.jar has been added.
  Input property 'classpath' file /home/ursl/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-web/17/bbd71beaf561b72f0d3eb6268d3114573b7799c3/javafx-web-17-linux.jar has been removed.

Even more strangely, these reported changes are not consistent. The "changed" dependencies vary every time the above commands are repeated.

UrsLange commented 2 years ago

The same behavior occures with the latest version of the plugin. Missed that in the original post, sorry.