Skip to content

Instantly share code, notes, and snippets.

@nisrulz
Created July 18, 2015 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nisrulz/0cd546b1cf277c2020e7 to your computer and use it in GitHub Desktop.
Save nisrulz/0cd546b1cf277c2020e7 to your computer and use it in GitHub Desktop.
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