Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Standard build.gradle configurations for a gradle based android app, with build flavours
buildTypes {
debug {
minifyEnabled false
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
}
release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors{
alpha {
applicationId "com.yourcompany.appname.alpha"
versionName "0.1-alpha"
}
beta {
applicationId "com.yourcompany.appnam.beta"
versionName "0.1-beta"
}
gamma {
applicationId "com.yourcompany.appnam.gamma"
versionName "0.1-gamma"
}
}
signingConfigs {
release {
try {
keyAlias KEYSTORE_ALIAS
keyPassword KEY_PASSWORD
storeFile file(KEYSTORE_FILEPATH)
storePassword KEYSTORE_PASSWORD
}
catch (ex) {
throw new InvalidUserDataException("You should define KEYSTORE_ALIAS, KEYSTORE_FILEPATH, KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
}
}
}
KEYSTORE_ALIAS=<keystore_alias>
KEYSTORE_PASSWORD=<keystore_password>
KEY_PASSWORD=<key_password>
KEYSTORE_FILEPATH=/path/to/your/keystore.jks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment