diff --git a/buildSrc/src/main/kotlin/krossbow-publish.gradle.kts b/buildSrc/src/main/kotlin/krossbow-publish.gradle.kts index d394b45f9..e95c211fe 100644 --- a/buildSrc/src/main/kotlin/krossbow-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/krossbow-publish.gradle.kts @@ -29,3 +29,21 @@ signing { useInMemoryPgpKeys(signingKey, signingPassword) sign(extensions.getByType().publications) } + +// Resolves issues with .asc task output of the sign task of native targets. +// See: https://github.com/gradle/gradle/issues/26132 +// And: https://youtrack.jetbrains.com/issue/KT-46466 +tasks.withType().configureEach { + val pubName = name.removePrefix("sign").removeSuffix("Publication") + + // These tasks only exist for native targets, hence findByName() to avoid trying to find them for other targets + + // Task ':linkDebug' uses this output of task ':signPublication' without declaring an explicit or implicit dependency + tasks.findByName("linkDebugTest$pubName")?.let { + mustRunAfter(it) + } + // Task ':compileTestKotlin' uses this output of task ':signPublication' without declaring an explicit or implicit dependency + tasks.findByName("compileTestKotlin$pubName")?.let { + mustRunAfter(it) + } +}