Skip to content

Commit

Permalink
Disable signing if artifacts are published to Maven Local
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Jan 15, 2024
1 parent b532688 commit 46762da
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
`maven-publish`
Expand Down Expand Up @@ -80,7 +80,10 @@ signing {
System.getenv("DOKKA_SIGN_KEY_PASSPHRASE")?.takeIf(String::isNotBlank),
)
sign(publishing.publications)
setRequired(provider { !project.version.toString().endsWith("-SNAPSHOT") })
setRequired(provider {
val isPublishedToMavenLocal = gradle.taskGraph.allTasks.any { it.name == "publishToMavenLocal" }
!project.version.toString().endsWith("-SNAPSHOT") && !isPublishedToMavenLocal
})
}

// This is a hack for a Gradle 8 problem, see https://github.com/gradle/gradle/issues/26091
Expand Down

0 comments on commit 46762da

Please sign in to comment.