Skip to content

Instantly share code, notes, and snippets.

@Elvis10ten
Last active December 12, 2017 05:25
Show Gist options
  • Save Elvis10ten/f89adebbf2ef9fad218343e2490262ff to your computer and use it in GitHub Desktop.
Save Elvis10ten/f89adebbf2ef9fad218343e2490262ff to your computer and use it in GitHub Desktop.
Product flavors
// There is a new feature in gradle 3.0.0 called flavorDimension that allows you to combine
// different product flavors. We will be using just the "default" dimension
flavorDimensions "default"
productFlavors {
dev {
dimension "default"
applicationIdSuffix '.dev' // The applicationId now becomes "com.mobymagic.shazamclone.dev"
versionNameSuffix "-dev" // The versionName you define above now have a "-dev" suffix
resValue "string", "app_name", "Shazam Clone Dev" // Changes the app name to "Shazam Clone Dev"
// [Performance optimization] The following configuration limits the "dev" flavor
// to using English string resources and xxhdpi screen-density resources.
resConfigs "en", "xxhdpi"
}
mock {
dimension "default"
applicationIdSuffix '.mock'
versionNameSuffix "-mock"
resValue "string", "app_name", "Shazam Clone Mock"
}
prod {
dimension "default"
resValue "string", "app_name", "Shazam Clone"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment