JDK-8199071 : Fix gradle deprecation warnings
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 10,openjfx11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-03-05
  • Updated: 2018-10-14
  • Resolved: 2018-03-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8u201Fixed openjfx11Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Description
When compiling JavaFX using gradle 4.3 we get a few deprecation warnings for features that will be removed in 5.0. At some point we will likely want to move to gradle 5, so these should be addressed before then.

Here is the list of warnings:

A problem was found with the configuration of task ':buildSrc:generateGrammarSource'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.

Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
        at build_61v2cahy4344a9o4ddauip62l.commonModuleSetup(/localhome/kcr/javafx/jfx-kcr/jfx/rt/build.gradle:867)

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_61v2cahy4344a9o4ddauip62l$_run_closure16.doCall(/localhome/kcr/javafx/jfx-kcr/jfx/rt/build.gradle:2076)

The Task.dependsOnTaskDidWork() method has been deprecated and is scheduled to be removed in Gradle 5.0. Instead, check the value of "didWork()" for each task, or declare the task inputs and outputs and let Gradle decide what needs to be run.
	at build_61v2cahy4344a9o4ddauip62l$_run_closure43$_closure353$_closure356.doCall(/localhome/kcr/javafx/jfx-kcr/jfx/rt/build.gradle:4199)
Comments
Changeset: 53878b83c2bd Author: kcr Date: 2018-03-15 16:13 -0700 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/53878b83c2bd 8199071: Fix gradle deprecation warnings Reviewed-by: prr, jvos
16-03-2018

I did not understand why there were changes to remove antlr related code but Kevin explained he found this was dead code. So +1 from me. -phil.
15-03-2018

As a clarification on one of the above comments: > All but one are trivial changes (including removal of some dead build logic). The main dead build logic that was removed was in buildSrc/build.gradle which still had a no-longer used generateGrammarSource target and the associated antlr references. This logic was moved to the main build.gradle file back in the jigsaw development time, but the old logic was mistakenly left in buildSrc/build.gradle.
15-03-2018

The changes in dalvik.gradle look correct to me.
13-03-2018

[~jvos] You might want to take a look at this, too.
08-03-2018

Webrev: http://cr.openjdk.java.net/~kcr/8199071/webrev.00/ This fixes all of the gradle deprecation warnings. All but one are trivial changes (including removal of some dead build logic). The change to remove the override of sourceSets.main.output.classesDir, which was added when fixing JDK-8185358 so we could transitionally build using gradle 3.x and 4.x, will require testing on all three platforms. As part of this change we need to use ".java.outputDir" instead of ".output.classesDir", since the latter is deprecated. Additionally, the necessary changes uncovered a problem with two of the unit tests, which were both passing without actually testing anything, because of JDK 9 jigsaw changes along with bugs in the test. I fixed the tests as part of this.
07-03-2018

This should be fixed before JDK-8198329 since it will change the layout of the intermediate build dirs (so it will be less work to do it now).
06-03-2018