diff --git a/build.gradle.kts b/build.gradle.kts index b3b8886..c5473dc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -202,6 +202,24 @@ if (isReleaseBuild) { } } + // 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 ':linkDebugTest' 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) + } + } + signing { useInMemoryPgpKeys( signingKey,