-
-
Save h4ck4life/d0909c62dceeed064c1a8bd31ab62360 to your computer and use it in GitHub Desktop.
Airbnb Gradle Flavors
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
... | |
apply from: './flavors.gradle' | |
... | |
android { | |
buildTypes { | |
productFlavors { | |
project.flavors.each { flavor, config -> | |
"$flavor" { | |
dimension 'scope' | |
if (flavor != 'full') { | |
versionNameSuffix ".$flavor" | |
} | |
} | |
} | |
} | |
} | |
} | |
... |
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
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