Skip to content

Instantly share code, notes, and snippets.

@mibrahimdev
Forked from gpeal/build.gradle
Created June 24, 2018 21:24
Show Gist options
  • Save mibrahimdev/14d3c2a6f67228ad7f109092ade3dc5b to your computer and use it in GitHub Desktop.
Save mibrahimdev/14d3c2a6f67228ad7f109092ade3dc5b to your computer and use it in GitHub Desktop.
Airbnb Gradle Flavors
...
apply from: './flavors.gradle'
...
android {
buildTypes {
productFlavors {
project.flavors.each { flavor, config ->
"$flavor" {
dimension 'scope'
if (flavor != 'full') {
versionNameSuffix ".$flavor"
}
}
}
}
}
}
...
class FlavorOptions {
final String entryModule
FlavorOptions(String entryModule) {
this.entryModule = entryModule
}
}
project.ext.flavors = [
full: new FlavorOptions(":flavor.full"),
foo: new FlavorOptions(":flavor.foo")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment