Skip to content

Commit

Permalink
Comment and continue
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed Feb 2, 2024
1 parent 263711b commit d0a3e3f
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ subprojects {
signing {
val signingKeyRaw = System.getenv("NEW_SIGNING_KEY_ID_BASE64")
if (signingKeyRaw == null) error("ERROR: No Signing Key Found")
// Seems like the right way was to have newlines after all but not the
// BEGIN PGP PRIVATE KEY BLOCK as part of the key.
// Seems like the right way was to have newlines after all the exported (ascii armored) lines
// and you can put them into the github-var with newlines but if you
// include the "-----BEGIN PGP PRIVATE KEY BLOCK-----" and "-----END PGP PRIVATE KEY BLOCK-----"
// parts with that then errors happen. Have a look at https://github.com/gradle/gradle/issues/15718 for more detail
// Ultimately however `iurysza` is only partially correct and they key-itself does not need to be escaped
// and can be put into a github-var with newlines.
val signingKey = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n\n${signingKeyRaw}\n-----END PGP PRIVATE KEY BLOCK-----"
useInMemoryPgpKeys(
System.getenv("NEW_SIGNING_KEY_ID_BASE64_ID"),
Expand All @@ -107,4 +111,20 @@ subprojects {
tasks.withType<Sign> {
onlyIf { !project.hasProperty("nosign") }
}

// Fix for Kotlin issue: https://youtrack.jetbrains.com/issue/KT-61313
tasks.withType<Sign>().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<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
tasks.findByName("linkDebugTest$pubName")?.let {
mustRunAfter(it)
}
// Task ':compileTestKotlin<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
tasks.findByName("compileTestKotlin$pubName")?.let {
mustRunAfter(it)
}
}
}

0 comments on commit d0a3e3f

Please sign in to comment.