Created
April 30, 2014 19:27
-
-
Save trevorrjohn/d505c8281d80c26a0409 to your computer and use it in GitHub Desktop.
Build on whitelisted 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
{ | |
// Preferences => Compiler => Gradle => VM Options. Add -DflavorWhitelist=flavor1,flavor2 | |
// Omit -DflavorWhitelist for all flavors. | |
def flavorMap = [ | |
flavor1: { | |
// flavor stuff | |
}, | |
flavor2 : { | |
// flavor 2 stuff | |
} | |
] | |
def whitelist = flavorMap.keySet() | |
def whitelistProp = System.getProperty("flavorWhitelist") | |
if (whitelistProp != null) { | |
whitelist = whitelistProp.split(",") | |
} | |
whitelist.each { flavorName -> | |
"$flavorName" flavorMap.get(flavorName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment