davidliu

add RELEASE_SIGNING_ENABLED flag to mvn push gradle script

@@ -51,6 +51,8 @@ signing.keyId= @@ -51,6 +51,8 @@ signing.keyId=
51 signing.password= 51 signing.password=
52 signing.secretKeyRingFile= 52 signing.secretKeyRingFile=
53 53
  54 +RELEASE_SIGNING_ENABLED=true
  55 +
54 # For instrumented tests. 56 # For instrumented tests.
55 # WARNING: Do not edit this and potentially commit to repo. 57 # WARNING: Do not edit this and potentially commit to repo.
56 # Instead, override in ~/.gradle/gradle.properties 58 # Instead, override in ~/.gradle/gradle.properties
@@ -47,6 +47,10 @@ def getRepositoryPassword() { @@ -47,6 +47,10 @@ def getRepositoryPassword() {
47 return hasProperty('nexusPassword') ? nexusPassword : "" 47 return hasProperty('nexusPassword') ? nexusPassword : ""
48 } 48 }
49 49
  50 +boolean getReleaseSigningEnabled() {
  51 + return hasProperty('RELEASE_SIGNING_ENABLED') ? RELEASE_SIGNING_ENABLED.toBoolean() : true
  52 +}
  53 +
50 def configurePom(pom) { 54 def configurePom(pom) {
51 pom.name = POM_NAME 55 pom.name = POM_NAME
52 pom.packaging = POM_PACKAGING 56 pom.packaging = POM_PACKAGING
@@ -151,9 +155,11 @@ afterEvaluate { project -> @@ -151,9 +155,11 @@ afterEvaluate { project ->
151 configurePom(publication.pom) 155 configurePom(publication.pom)
152 } 156 }
153 157
  158 + if (getReleaseSigningEnabled()) {
154 signing { 159 signing {
155 publishing.publications.all { publication -> 160 publishing.publications.all { publication ->
156 sign publication 161 sign publication
157 } 162 }
158 } 163 }
  164 + }
159 } 165 }