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
workaround issues with the signing setup #404
Conversation
add6142
to
0ed6c1e
Compare
project.tasks.withType(PublishToMavenRepository::class.java).configureEach { publishTask -> | ||
if (publishTask.name.endsWith("ToMavenCentralRepository")) { | ||
publishTask.dependsOn(createRepository) |
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.
Found out that PublishToMavenRepository
is in the public API so we can use it here as a filter which makes it nicer than afterEvaluate
0ed6c1e
to
c4cd3bc
Compare
// TODO: replace with the following line after https://github.com/gradle/gradle/issues/21857 is fixed | ||
// project.gradleSigning.sign(project.gradlePublishing.publications) | ||
project.gradlePublishing.publications.withType(MavenPublication::class.java).all { publication -> | ||
val task = project.tasks.findByName("sign${publication.name.capitalize()}Publication") | ||
if (task == null) { | ||
project.gradleSigning.sign(publication) | ||
} | ||
} |
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.
Only call sign on a publication if there is no signing task for it yet which fixes the issue when other plugins already called it.
c4cd3bc
to
eb8e98e
Compare
// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed | ||
project.tasks.withType(AbstractPublishToMaven::class.java) { publishTask -> | ||
publishTask.dependsOn(project.tasks.withType(Sign::class.java)) | ||
} |
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.
Workaround taken from the linked ticket
closes #387
closes #338