Skip to content

Commit 9d4306b

Browse files
committed
Fix implicit dependency between signing and publication tasks
By making it explicit
1 parent dc8d586 commit 9d4306b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main/src/kotlinx/team/infra/Publishing.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,14 @@ private fun Project.configureSigning() {
272272
if (keyId != null) {
273273
project.extensions.configure<SigningExtension>("signing") {
274274
useInMemoryPgpKeys(keyId, signingKey, signingKeyPassphrase)
275-
sign(extensions.getByType(PublishingExtension::class.java).publications) // all publications
275+
val signingTasks = sign(extensions.getByType(PublishingExtension::class.java).publications) // all publications
276+
// due to each publication including the same javadoc artifact file,
277+
// every publication signing task produces (overwrites) the same javadoc.asc signature file beside
278+
// and includes it to that publication
279+
// Thus, every publication publishing task implicitly depends on every signing task
280+
tasks.withType(AbstractPublishToMaven::class.java).configureEach {
281+
dependsOn(signingTasks) // make this dependency explicit
282+
}
276283
}
277284
} else {
278285
logger.warn("INFRA: signing key id is not specified, artifact signing is not enabled.")

0 commit comments

Comments
 (0)