JDK-8226754 : FX build fails using gradle 5.6+ or 6
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: openjfx13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-06-25
  • Updated: 2021-05-10
  • Resolved: 2019-10-14
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.
Other
openjfx11.0.12Fixed
Related Reports
Blocks :  
Description
When compiling the current JavaFX using gradle 5.3, we get two deprecation warnings for features that will be removed in 6.0. At some point we will likely want to move to gradle 6, so these should be addressed before then.

1. enableFeaturePreview('STABLE_PUBLISHING')

enableFeaturePreview('STABLE_PUBLISHING') has been deprecated. This is scheduled to be removed in Gradle 6.0. The feature flag is no longer relevant, please remove it from your settings file.
	at settings_1mxe2ji3njomuaudhj2grcf3n.run(/localhome/kcr/javafx/github/kcr-jfx/settings.gradle:40)


2. IvyArtifactRepository.layout(String, Closure)

The IvyArtifactRepository.layout(String, Closure) method has been deprecated. This is scheduled to be removed in Gradle 6.0. Please use the IvyArtifactRepository.patternLayout(Action) method instead.
	at build_cy0kvghox5p95hcs9p72niyqm$_run_closure14$_closure91$_closure98.doCall(/localhome/kcr/javafx/github/kcr-jfx/build.gradle:1842)


The first one was added as a transitional step to allow us to support both gradle 4 and gradle 5 while we were moving to gradle 5. It can be removed, and will require bumping the minimum version of gradle to 5.x (we've long been using 5.3 so that isn't a problem).

The second one should be simple replacement to use the newer API. I note that the same pattern appears in multiple places in build.gradle and one place in buildSrc/biuld.gradle, all of which will need to be fixed.
Comments
Changeset: 64aaeb84 Author: Kevin Rushforth <kcr@openjdk.org> Date: 2019-10-14 15:37:12 +0000 URL: https://git.openjdk.java.net/jfx/commit/64aaeb84 8226754: FX build fails using gradle 5.6+ or 6 Remove obsolete STABLE_PUBLISHING; explicitly set output.resourcesDir; bump minimum gradle version to 5.3 Reviewed-by: jvos
14-10-2019

Based on the review comments in https://github.com/openjdk/jfx/pull/9 I am going to defer the changes in above items 2-3 until the actual switch to gradle 6. This way we can avoid relying upon an incubating API for as long as we are still using gradle 5.3 in production builds. This bug will therefore address the removal of the STABLE_PUBLISHING preview feature, bumping the minimum version to 5.3 (because of the previous), and setting the `output.resourceDir` correctly.
09-10-2019

Review: https://github.com/openjdk/jfx/pull/9
08-10-2019

A couple additional problems have been discovered, one of which was reported by [~swpalmer] on the openjfx-dev list, and affects gradle 5.6.2. 3. Now that gradle 6 nightly builds are ready and reasonably stable, I discovered another change needed in the configuration of the ivy artifact repository in addition to #2 above. gradle 6 fails to download the artifacts without corresponding meta data (previously it would ignore them). In addition to changing `layout "pattern",` to `patternLayout`, we also need to add the following to all of our ivy repository definitions: metadataSources { artifact() } 4. The resources are not being copied into the right place in the build directory due to some change in gradle 5.6 that affects the value of `output.resourceDir` for the sourcesets of modular projects. This might be a latent bug in our build.gradle file where a change to gradle exposed the problem, but either way we need to set` output.resourceDir` correctly so that the resources will be copied.
07-10-2019

Regarding #2, I note that the recommended replacement, patternLayout(Action), is an incubating API. It's unfortunate that gradle chose to deprecate an API in Gradle 5 with a stated intention to remove it in Gradle 6, without providing a stable API we can use to manage the transition. Since we can't be sure that the patternLayout API won't change, it's probably best to hold off changing anything until there is a stable replacement.
25-06-2019