Skip to content

Instantly share code, notes, and snippets.

@bholota
Created August 26, 2015 12:34
Show Gist options
  • Save bholota/b9a32e4935399b4419ee to your computer and use it in GitHub Desktop.
Save bholota/b9a32e4935399b4419ee to your computer and use it in GitHub Desktop.
siging config
android {
signingConfigs {
release {
storeFile file(fileConfig['keystore_dir'])
storePassword fileConfig['keystore_password']
keyAlias fileConfig['key_alias']
keyPassword fileConfig['key_password']
}
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
buildConfigField "String", URL, URL_PRODUCTION
buildConfigField "boolean", "MOCKUP", "false"
}
}
}
def getReleaseSigningConfig() {
Properties p = new Properties()
FileInputStream fileConfigIS;
try {
fileConfigIS = new FileInputStream(file("../signing.properties"));
p.load(fileConfigIS);
} catch (FileNotFoundException ex) {
def debugKeyDir = System.getenv('HOME') + "/.android/debug.keystore"
p.setProperty('keystore_dir', debugKeyDir)
p.setProperty('key_alias', 'androiddebugkey')
p.setProperty('keystore_password', 'android')
p.setProperty('key_password', 'android')
logger.warn("Using default debug key instead of release key, missing release key configuration file!")
}
return p;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment