Created
July 18, 2015 20:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildTypes { | |
debug { | |
minifyEnabled false | |
applicationIdSuffix '.debug' | |
versionNameSuffix '-debug' | |
} | |
release { | |
signingConfig signingConfigs.release | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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