I have several build types: debug
, release
.
I also have two flavors pub
and dev
.
pub
flavored applic
Follow up @dooplaye's example, assume you only want to compile leanback in one flavor, you could refer to below snippet:
applicationVariants.all { variant ->
def flavorString = ""
def flavors = variant.productFlavors
for (int i = 0; i < flavors.size(); i++) {
flavorString += flavors[i].name;
}
if (flavorString.equalsIgnoreCase("pubdeb")) {
dependencies {
compile('com.android.support:leanback-v17:22.2.1')
}
}
}