Skip to content
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

Don't share state via NexusRepository #11

Merged
merged 1 commit into from
Jan 12, 2020

Conversation

marcphilipp
Copy link
Member

  • Remove stagingProfileId from close/release tasks as it is not needed
  • Wire stagingRepositoryId for close/release task in plugin
  • Remove mutable state from NexusRepository
  • Rename CLI option to --staging-repository-id to make it more idiomatic

- Remove stagingProfileId from close/release tasks as it is not needed
- Wire stagingRepositoryId for close/release task in plugin
- Remove mutable state from NexusRepository
- Rename CLI option to --staging-repository-id to make it more idiomatic
@marcphilipp marcphilipp requested a review from szpak January 11, 2020 13:57
@marcphilipp marcphilipp self-assigned this Jan 11, 2020

@Optional
@Input
val packageGroup = objects.property<String>().apply {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, packageGroup is not important for close and release.

project.tasks.register("publishTo${capitalizedName()}") {
description = "Publishes all Maven publications produced by this project to the '${[email protected]}' Nexus repository."
group = PublishingPlugin.PUBLISH_TASK_GROUP
}
project.tasks
.register<InitializeNexusStagingRepository>("initialize${capitalizedName()}StagingRepository", project.objects, extension, this, serverUrlToStagingRepoUrl)
.register<InitializeNexusStagingRepository>("initialize${capitalizedName()}StagingRepository", project.objects, extension, this, serverUrlToStagingRepoUrl, { id: String -> stagingRepositoryId.set(id) })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the trick to use a function to set (and later use) dangling property in not directly bound contexts. It greatly reduced complexity of the workaround on finalized properties in Gradle.


@get:Input
val snapshotRepositoryUrl: Property<URI> = project.objects.property()
@Input
Copy link
Contributor

@szpak szpak Jan 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests confirms it works, but the related documentation doesn't cover that topic:

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

Is it the recommenced approach for Kotlin? Then I could propose JavaDoc improvement to: or the property in Groovy/Kotlin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll bring this up with the Gradle team.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now an issue: gradle/gradle#11927

@szpak szpak merged commit 6ce5c2b into closeAndRelease Jan 12, 2020
@marcphilipp marcphilipp added this to the 0.1.0 milestone May 31, 2020
@marcphilipp marcphilipp deleted the marc/stop-sharing-state-via-nexus-repo branch November 14, 2021 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants