-
Notifications
You must be signed in to change notification settings - Fork 546
8333146: Move maven publication logic from build.gradle #1970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
|
Reviewers: @johanvos @tiainen and one of @kevinrushforth or @arapte /reviewers 2 reviewers |
|
@kevinrushforth |
|
Note that there's a relevant stale PR in #1232 by @jjohannes. Maybe he'd like to take a look. |
Thanks. It looks like my work will not block/interfere the implementation of that PR, which is good. |
|
Thanks for the ping. I have to rework my PR anyway. There is no need to pay special attention to it. Any change that makes the publishing setup clearer is good IMO. I think this PR is a good step forward. (I didn't get back to the topic yet on the my PR, because it is more work as I initially expected. What is complicating things me there is how conceptually get the setup right with the Jars for different platform built on different machines. I have to set aside some mote time for it.) |
|
I found a way to further decouple the maven publishing logic! Now we only need to: It will work like before, so there is no logical change. But still need a re-review. I retested all configurations. |
|
@tiainen reviewed it and is ok with it. I had a quick look, and it doesn't cause regression. Also note that we're making progress with the build-openjfx-using-openjdk project, and we hope to create our builds with that approach in the near future. |
Indeed! My bad, I didn't express myself clearly. What I meant was that everyone who has already checked this needs to check it again, as some things have changed (not just minor things like the copyright). |
That sounds very promising. Good to hear! |
Thanks. I can reproduce this! I always built the sdk first and then run the publishing. But you are right, this should work together as well. My guess is that the maven task need to depend on the build task, that should fix both problems. Will do some testing and report back. |
|
Both issues should be fixed now. It really was just a matter of depending the maven publication task on the |
|
I ran the same command With this PR, for a module a few additional tasks get executed compared to without PR. So, the content of build directories differ. With this change there are 2 additional directories created under build dir:
I am not sure which is more correct behavior or if it can cause any issue. |
Thanks a lot for testing as well! Line 5850 in f87448e
Which I think is much more error prone and also risks that we forget something or it is executed too early in the future. |
|
@Maran23 I agree that the change @arapte noted above is fine, and your explanation makes sense. I did find one other difference in artifacts created. With the current master, running However, I also note that with this patch, even |
Thanks for testing! |


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 register all modules for publication.This way, we decoupled the logic that much, the only things we need to do:
maven-publish.gradleconfigureMavenPublicationlater in the build chain.To better understand the context, this is the commit where the whole Maven Publishing logic was introduced. I moved all of that logic out of the main
build.gradle: 5a18677This will reduce the size by ~170 lines for the
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:

-> Example: 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
buildDir, the deprecatedproject.taskmethod and 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.
Note2: I did a small improvement to the
addMavenPublicationmethod. It is now more 'typesafe', e.g. projects must be passed in directly, not as String. If a project does not exist, the build will fail with an exception.Progress
Issue
Reviewers
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