Add mapping from underscore separator to dot separator for signing task properties so that they can be passed to Gradle as environment variables
@@ -81,6 +81,25 @@ configure(subprojects.findAll { it.name != 'util' }) {
}
}
+ /*
+ For security we allow the signing-related project properties to be passed in as environment variables, which
+ Gradle enables if they are prefixed with "ORG_GRADLE_PROJECT_". But since environment variables can not contain
+ the '.' character and the signing-related properties contain '.', here we map signing-related project properties with '_'
+ to ones with '.' that are expected by the signing plugin.
+ */
+ gradle.taskGraph.whenReady { taskGraph ->
+ if (taskGraph.allTasks.any { it instanceof Sign }) {
+ if (project.hasProperty("signing_keyId")) {
+ allprojects { ext."signing.keyId" = project.property("signing_keyId") }
+ }
+ if (project.hasProperty("signing_secretKeyRingFile")) {
+ allprojects { ext."signing.secretKeyRingFile" = project.property("signing_secretKeyRingFile") }
+ }
+ if (project.hasProperty("signing_password")) {
+ allprojects { ext."signing.password" = project.property("signing_password") }
+ }
+ }
+ }
tasks.withType(AbstractCompile) {
options.encoding = 'ISO-8859-1'
