-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
marcphilipp
commented
Jan 11, 2020
- 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
|
||
@Optional | ||
@Input | ||
val packageGroup = objects.property<String>().apply { |
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.
+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) }) |
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 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 |
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.
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
.
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'll bring this up with the Gradle team.
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.
It's now an issue: gradle/gradle#11927