Merge branch 'master' into 4.0.x (apk signing with interactive passwords)

This commit is contained in:
Andrew Grieve 2014-12-22 10:22:24 -05:00
commit 59d23e05b1

View File

@ -109,9 +109,9 @@ android {
release { release {
// These must be set or Gradle will complain (even if they are overridden). // These must be set or Gradle will complain (even if they are overridden).
keyAlias = "" keyAlias = ""
keyPassword = "" keyPassword = "__unset" // And these must be set to non-empty in order to have the signing step added to the task graph.
storeFile = null storeFile = null
storePassword = "" storePassword = "__unset"
} }
} }
buildTypes { buildTypes {
@ -161,11 +161,10 @@ def promptForReleaseKeyPassword() {
if (!System.env.RELEASE_SIGNING_PROPERTIES_FILE) { if (!System.env.RELEASE_SIGNING_PROPERTIES_FILE) {
return; return;
} }
if (!android.signingConfigs.release.storePassword) { if ('__unset'.equals(android.signingConfigs.release.storePassword)) {
android.signingConfigs.release.storePassword = promptForPassword('Enter key store password: ') android.signingConfigs.release.storePassword = promptForPassword('Enter key store password: ')
println('set to:' + android.signingConfigs.release.storePassword)
} }
if (!android.signingConfigs.release.keyPassword) { if ('__unset'.equals(android.signingConfigs.release.keyPassword)) {
android.signingConfigs.release.keyPassword = promptForPassword('Enter key password: '); android.signingConfigs.release.keyPassword = promptForPassword('Enter key password: ');
} }
} }
@ -207,9 +206,9 @@ def addSigningProps(propsFilePath, signingConfig) {
throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath()) throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath())
} }
signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias') signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
signingConfig.keyPassword = props.get('keyPassword') signingConfig.keyPassword = props.get('keyPassword', signingConfig.keyPassword)
signingConfig.storeFile = storeFile signingConfig.storeFile = storeFile
signingConfig.storePassword = props.get('storePassword') signingConfig.storePassword = props.get('storePassword', signingConfig.storePassword)
def storeType = props.get('storeType') def storeType = props.get('storeType')
if (!storeType) { if (!storeType) {
def filename = storeFile.getName().toLowerCase(); def filename = storeFile.getName().toLowerCase();