Ryan Brink
09/18/2023, 1:12 AMReason: Task ':satisfaketion-mutators:publishKotlinMultiplatformPublicationToSonatypeRepository' uses this output of task ':satisfaketion-mutators:signSatisfaketion-mutatorsPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':satisfaketion-mutators:signSatisfaketion-mutatorsPublication' as an input of ':satisfaketion-mutators:publishKotlinMultiplatformPublicationToSonatypeRepository'.
2. Declare an explicit dependency on ':satisfaketion-mutators:signSatisfaketion-mutatorsPublication' from ':satisfaketion-mutators:publishKotlinMultiplatformPublicationToSonatypeRepository' using Task#dependsOn.
3. Declare an explicit dependency on ':satisfaketion-mutators:signSatisfaketion-mutatorsPublication' from ':satisfaketion-mutators:publishKotlinMultiplatformPublicationToSonatypeRepository' using Task#mustRunAfter.
For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
I don't understand why the signSatisfaketion
output wouldn't be associated with publishKotlinMultiplatformPublicationToSonatypeRepository
, since i thought that declaring this block
signing {
sign(publishing.publications)
}
Created that dependency implicitly. Am i incorrect? and regardless, does anyone have any idea how to resolve this issue 🙂 would really appreciate the helpAdam S
09/18/2023, 8:16 AMRyan Brink
09/18/2023, 5:34 PM> Task :satisfaketion-core:publishSatisfaketion-corePublicationToSonatypeRepository
Multiple publications with coordinates 'io.github.unredundant:satisfaketion-core:0.8.2' are published to repository 'sonatype'. The publications 'kotlinMultiplatform' in project ':satisfaketion-core' and 'satisfaketion-core' in project ':satisfaketion-core' will overwrite each other!
> Task :satisfaketion-mutators:publishSatisfaketion-mutatorsPublicationToSonatypeRepository
Multiple publications with coordinates 'io.github.unredundant:satisfaketion-mutators:0.8.2' are published to repository 'sonatype'. The publications 'kotlinMultiplatform' in project ':satisfaketion-mutators' and 'satisfaketion-mutators' in project ':satisfaketion-mutators' will overwrite each other!
> Task :satisfaketion-generators:publishSatisfaketion-generatorsPublicationToSonatypeRepository
Multiple publications with coordinates 'io.github.unredundant:satisfaketion-generators:0.8.2' are published to repository 'sonatype'. The publications 'kotlinMultiplatform' in project ':satisfaketion-generators' and 'satisfaketion-generators' in project ':satisfaketion-generators' will overwrite each other!
I can see in my local repo that things are named as i would expect
> ls ~/.m2/repository/io/github/unredundant -al
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-core
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-core-js
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-core-jvm
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-generators
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-generators-js
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-generators-jvm
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-mutators
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-mutators-js
drwxr-xr-x@ - megame 16 Sep 16:57 satisfaketion-mutators-jvm
Adam S
09/18/2023, 5:39 PMpublications {
register<MavenPublication>("satisfaketion-generators") {
somewhere?Ryan Brink
09/19/2023, 2:04 PMkotlin
block for whatever reason
val publicationsFromMainHost =
listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
publishing {
publications {
matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
}
}
}
figured it out from this doc https://kotlinlang.org/docs/multiplatform-publish-lib.html#avoid-duplicate-publications
I guess that the kotlin multiplatform plugin (unlike the kotlin jvm plugin?) has its own publication logic that can manipulate the gradle publishing flow?Ryan Brink
09/19/2023, 2:09 PM