-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support publishing using Ivy #222
Support publishing using Ivy #222
Conversation
Ivy publications are used when the layout of the deployed artifacts needs to be customized, e.g. when publishing Sbt plugins.
Add a fallback url for the early url check inside IvyPublishingPlugin Add a the proper task ids for the nexus plugin to depend on for ivy publishing as well Change publication types to be a single property instead of a set
Move the already existing tests to a BaseNexusPublishPluginTests and move all Ivy/Maven specific test to aptly named test classes
Removed some accidental reformats |
src/main/kotlin/io/github/gradlenexus/publishplugin/NexusPublishExtension.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Marc Philipp <marc@gradle.com>
UrlArtifactRepository was only introduced in gradle 5.1 and gradle modules are not uploaded in gradle 5
It makes more sense to have these properties configured on an individual repository level rather than at the plugin level This will allow the configuration of repositories with different publication types and repository layouts, mimics the original gradle configuration more closely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few details, but in general it looks good.
src/compatTest/kotlin/io/github/gradlenexus/publishplugin/BaseNexusPublishPluginTests.kt
Show resolved
Hide resolved
src/compatTest/kotlin/io/github/gradlenexus/publishplugin/MavenNexusPublishPluginTests.kt
Outdated
Show resolved
Hide resolved
src/compatTest/kotlin/io/github/gradlenexus/publishplugin/IvyNexusPublishPluginTests.kt
Outdated
Show resolved
Hide resolved
src/e2eTest/kotlin/io/github/gradlenexus/publishplugin/e2e/NexusPublishE2ETests.kt
Show resolved
Hide resolved
src/main/kotlin/io/github/gradlenexus/publishplugin/NexusPublishPlugin.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/io/github/gradlenexus/publishplugin/internal/Gradle5ArtifactRepositoryExtensions.kt
Outdated
Show resolved
Hide resolved
Move publishType and ivyRepositoryPattern to NexusRepository
@szpak There are some new changes that we discussed with @marcphilipp Moving publicationType and ivyRepositoryPattern to the NexusRepository level instead of the extension level |
Move commits that were pushed to the incorrect repo
It seems to be ready. Thanks @maczikasz for your contribution! I need some time to review the other 2.0.0 candidates, but I will try to merge & release it "soon". |
Btw, do you guys have anything in mind which could/should be done before 2.0.0 (as a breaking change, in addition to dropping "build support" for <JDK 11)? |
Thanks for reviewing. If you merge and maybe will there be a snapshot or pre-release version that we could use before release? We have time to wait for the release before needing this in our side for production, but would be really cool to try it out before |
src/main/kotlin/io/github/gradlenexus/publishplugin/NexusPublishPlugin.kt
Outdated
Show resolved
Hide resolved
Fixed signing.
Old Sonatype Nexus and publicationType place in the extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved your changes to the other branch and tested e2e. I had to do some minor adjustments (1, 2) in e2e projects, but it the end, all of them passed: https://github.com/gradle-nexus/publish-plugin/actions/runs/5149777155/jobs/9273194799
I also forked them in the gradle-nexus group to make a possibility to push the changes (however, I still plan to test the "e2e projects inline in the main repo" idea). Of course, extracting the core e2e logic still holds true :-).
Sure, I just have to merge some long awaiting PRs and it takes time due to the CI builds. Probably I could merge them locally to on another branch to merge it at once. |
@maczikasz It's quite harder than I initially thought :-/. I completely forgot that in this project there is no publishing to Maven Central configured and I cannot send snapshots there. Is it possible to release a snapshot version of the plugin to plugins.gradle.org? Or you had anything else in mind (e.g. publishing |
This works on Gradle 8.2-milestone-1, but breaks on 8.2-rc-1: |
@szpak others do publish rcs like that: https://plugins.gradle.org/plugin/org.ajoberstar.stutter, even Gradle itself https://plugins.gradle.org/plugin/com.gradle.plugin-publish |
Good catch, thanks @TWiStErRob . It seems to be an another issue with the new tests for Ivy. I added build scan to that workflow and the reported error is not something that I expected :-/
@maczikasz Could there be any general regressions in the recent code in master? |
Note: there's one mention of Ivy in the release notes, however that issue was also included in milestone-1's release notes. Ref https://docs.gradle.org/8.2-rc-1/release-notes.html |
Sorry guys for missing the notifications checking now the failures |
@maczikasz I reran it with 8.2-rc-2 and it still fails: |
thanks @szpak Yes, I know what the issue is, it seems that the url is cached in the I raised it internally, I have managed to do a very (VERY) hacky solutions to get the test green, but I need a better way, and also to understand if this is intended or not |
@maczikasz To give you a chance to test the Ivy functionality in a real usage, I've just released 2.0.0-rc-1 to the portal. We still plan some minor changes (and maybe in the meantime you will find a less hacky solution for the url issue ;-) ), but please let us know, if it works for you at all. |
@szpak I have finished testing the ivy publication with 2.0.0.-rc-1 and everything seems to work as expected, I have managed to release things to sonatype and use it subsequently. Thanks a lot for your support on this |
This PR is aimed to support publishing to sonatype nexus using IvyPublication
The change adds extra configuration options for ivy and hooks into ivy-publish as well as maven-publish to create the required tasks for pushing to sonatype
The compat tests are ran for both publish plugin typesm only duplicated where the artifact patterns are different for the assertions
There are 2 end to end test repositories that are currently hosted under my github, these could be moved over to any of the maintainer's github
Readme is also updated
This PR builds on the initial work of @marcphilipp