Skip to content

Instantly share code, notes, and snippets.

@letroll
Last active July 6, 2017 11:37
Show Gist options
  • Save letroll/b06704340947b8d140dd to your computer and use it in GitHub Desktop.
Save letroll/b06704340947b8d140dd to your computer and use it in GitHub Desktop.
[gradle android signinConfigs] gradle android signinConfigs #gradle #android #signature
signingConfigs {
release
}
defaultConfig {
signingConfig signingConfigs.release
}
def Properties props = new Properties()
def homePath = System.properties['user.home']
def propFile = new File(homePath, '.gradle/gradle.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') &&
props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment