Skip to content

Commit ceb89ff

Browse files
committed
chore: Attempt5
1 parent 553dc18 commit ceb89ff

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gradle/build-logic/src/main/kotlin/plugins/publishing.gradle.kts

+7-5
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ nmcp {
106106

107107
signing {
108108
setRequired { hasSigningKey }
109-
useInMemoryPgpKeys(signingKeyId.orNull, signingKey.orNull, signingPassword.orNull)
109+
if (hasSigningKey) {
110+
useInMemoryPgpKeys(signingKeyId.orNull, signingKey.orNull, signingPassword.orNull)
111+
// useGpgCmd()
112+
}
110113
sign(publishing.publications)
111-
// useGpgCmd()
112-
// isPublish = gradle.taskGraph.allTasks.any { it.name.startsWith("publish") }
114+
// gradle.taskGraph.allTasks.any { it.name.startsWith("publish") }
113115
}
114116

115117
fun MavenPublication.configurePom() {
@@ -144,11 +146,11 @@ fun MavenPublication.configurePom() {
144146
}
145147

146148
tasks {
147-
withType<Sign>().configureEach { onlyIf { hasSigningKey } }
148-
149149
// Suppressing publication validation errors
150150
withType<GenerateModuleMetadata> { suppressedValidationErrors.add("enforced-platform") }
151151

152+
withType<Sign>().configureEach { onlyIf { hasSigningKey } }
153+
152154
// For publishing kotlin native binaries
153155
withType<PublishToMavenRepository>().configureEach { mustRunAfter(withType<KotlinNativeLink>()) }
154156

0 commit comments

Comments
 (0)