Skip to content

Commit

Permalink
Add ability to force sign or detect if signature is required
Browse files Browse the repository at this point in the history
  • Loading branch information
codlab committed Feb 5, 2024
1 parent c2ab917 commit c0cfede
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions configurations/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ afterEvaluate {
.collect { rootProject.ext.prop(it, null) }
.find { null != it} as String

def isSigned = null != signingKeyId || null != rootProject.ext.prop("SIGN", null)

println("publication: Using signature key matching id ${signingKeyId}")
println("publication: will the package be signed ? ${isSigned}")

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set("sources")
Expand Down Expand Up @@ -113,10 +118,7 @@ afterEvaluate {
}

signing {
setRequired {
gradle.taskGraph.allTasks.any { it instanceof PublishToMavenRepository }
&& (null != signingKeyId && signingKeyId.length() > 0)
}
setRequired { isSigned }
sign publishing.publications.release
}
}
2 changes: 1 addition & 1 deletion dolbyio.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def version = 'v1.7.0'
def version = 'v1.7.1'

if (settings.ext.find("DOLBYIO_GRADLE_VERSION_USED")) {
version = DOLBYIO_GRADLE_VERSION_USED
Expand Down

0 comments on commit c0cfede

Please sign in to comment.