Skip to content

Commit 6099ee4

Browse files
committed
Fix recursion error in signing optionality.
1 parent 071eece commit 6099ee4

File tree

1 file changed

+14
-3
lines changed
  • project-plugins/src/main/kotlin/net/devrieze/gradle/ext

1 file changed

+14
-3
lines changed

project-plugins/src/main/kotlin/net/devrieze/gradle/ext/publishing.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ fun Project.doPublish(
7373
priv_key != null && passphrase != null -> useInMemoryPgpKeys(priv_key, passphrase)
7474

7575
System.getenv("JITPACK").equals("true", true) -> {
76-
logger.warn("No private key information found in environment. Running on Jitpack, skipping signing")
77-
setRequired(false)
76+
if (!rootProject.hasProperty("NO_SIGNING")) {
77+
logger.warn("No private key information found in environment. Running on Jitpack, skipping signing")
78+
79+
setRequired(false)
80+
rootProject.setProperty("NO_SIGNING", true)
81+
}
7882
}
7983

8084
else -> {
@@ -125,7 +129,14 @@ fun Project.doPublish(
125129

126130

127131
configure<SigningExtension> {
128-
setRequired { isRequired && gradle.taskGraph.run { hasTask("publish") || hasTask("publishNative") } }
132+
when {
133+
rootProject.findProperty("NO_SIGNING") == true ->
134+
setRequired(false)
135+
136+
else ->
137+
setRequired { gradle.taskGraph.run { hasTask("publish") || hasTask("publishNative") } }
138+
139+
}
129140

130141
val publishing = extensions.findByType<PublishingExtension>()
131142
val signTasks = sign(publishing!!.publications)

0 commit comments

Comments
 (0)