jean
07/10/2023, 10:30 AM* What went wrong:
A problem was found with the configuration of task ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' (type 'PublishToMavenRepository').
- Gradle detected a problem with the following location: '/Users/jeantuffier/Repos/statemachine/core/build/libs/core-0.2.0-dev13-javadoc.jar.asc'.
Reason: Task ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' uses this output of task ':core:signIosArm64Publication' 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 ':core:signIosArm64Publication' as an input of ':core:publishIosSimulatorArm64PublicationToSonatypeRepository'.
2. Declare an explicit dependency on ':core:signIosArm64Publication' from ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' using Task#dependsOn.
3. Declare an explicit dependency on ':core:signIosArm64Publication' from ':core:publishIosSimulatorArm64PublicationToSonatypeRepository' using Task#mustRunAfter.
* What went wrong:
A problem was found with the configuration of task ':core:signIosSimulatorArm64Publication' (type 'Sign').
- Gradle detected a problem with the following location: '/Users/jeantuffier/Repos/statemachine/core/build/libs/core-0.2.0-dev13-javadoc.jar.asc'.
Reason: Task ':core:publishIosArm64PublicationToSonatypeRepository' uses this output of task ':core:signIosSimulatorArm64Publication' 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 ':core:signIosSimulatorArm64Publication' as an input of ':core:publishIosArm64PublicationToSonatypeRepository'.
2. Declare an explicit dependency on ':core:signIosSimulatorArm64Publication' from ':core:publishIosArm64PublicationToSonatypeRepository' using Task#dependsOn.
3. Declare an explicit dependency on ':core:signIosSimulatorArm64Publication' from ':core:publishIosArm64PublicationToSonatypeRepository' using Task#mustRunAfter.
Is it possible that there is a bug somewhere that make wrong task matches?
publishIosSimulatorArm64PublicationToSonatypeRepository
should depends on signIosSimulatorArm64Publication
and not signIosArm64Publication
as the error suggests. And the opposite for the second error.
I can fix it by adding this to my gradle scripts, but it feels wrong.
tasks.named("publishIosArm64PublicationToSonatypeRepository") {
dependsOn(tasks.named("signIosSimulatorArm64Publication"))
}
tasks.named("publishIosSimulatorArm64PublicationToSonatypeRepository") {
dependsOn(tasks.named("signIosArm64Publication"))
}
Adam S
07/10/2023, 10:32 AM//region Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies
// <https://youtrack.jetbrains.com/issue/KT-46466>
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}
//endregion
jean
07/10/2023, 10:59 AM