8333146: Move maven publication logic from build.gradle #1970
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR splits the maven publishing logic into an own file,
maven-publish.gradle, that is next to the rootbuild.gradle.The
build.gradlewill apply themaven-publish.gradle. Themaven-publish.gradlewill then configure the Maven related properties and providesaddMavenPublicationasClosure.This way, the logic and code can be completely the same. All modules still call
addMavenPublication, as before.jfx/build.gradle
Lines 2894 to 2898 in 013e55b
But the publishing code and properties itself are out of the main
build.gradle.Tested with:
./gradlew -PMAVEN_PUBLISH=true -PMAVEN_VERSION=custom publishToMavenLocal./gradlew -PMAVEN_PUBLISH=true publishToMavenLocal./gradlew -PMAVEN_PUBLISH=true -PMILESTONE_FCS=true publishToMavenLocalEverything still works:

-> javafx.base from the local .m2 repository
I think this is a good step and an easy way to split out functionality without blowing things up. We might want to do that for other parts as well.
Note: I also fixed the deprecated
buildDirand 2 warnings where it seems like he might not be able to infer the type (changingdefto the actual type).-> The file is completely green, no warnings or deprecations.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1970/head:pull/1970$ git checkout pull/1970Update a local copy of the PR:
$ git checkout pull/1970$ git pull https://git.openjdk.org/jfx.git pull/1970/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1970View PR using the GUI difftool:
$ git pr show -t 1970Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1970.diff
Using Webrev
Link to Webrev Comment