Skip to content

Instantly share code, notes, and snippets.

@MarkMjw
Last active December 31, 2015 14:19
Show Gist options
  • Save MarkMjw/7999509 to your computer and use it in GitHub Desktop.
Save MarkMjw/7999509 to your computer and use it in GitHub Desktop.
Reading the value of keystore from file.
allprojects {
afterEvaluate { project ->
// you should define property in keystore.properties like this :
// storePassword="..."
// keyPassword="..."
// keyAlias="..."
// storeFile="..."
def propsFile = rootProject.file('keystore.properties')
def configName = 'release'
if (propsFile.exists() && android.signingConfigs.hasProperty(configName)) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
android.signingConfigs[configName].storeFile = file(props['storeFile'])
android.signingConfigs[configName].storePassword = props['storePassword']
android.signingConfigs[configName].keyAlias = props['keyAlias']
android.signingConfigs[configName].keyPassword = props['keyPassword']
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment