ProFlavor is the plugin for extending the android product flavors. When you use multiple dimensions you can not define unique build config fields or res values per flavor:
android {
flavorDimensions 'brand', 'version'
productFlavors {
Brand1 {
dimension 'brand'
}
Brand2 {
dimension 'brand'
}
Brand3 {
dimension 'brand'
}
Store {
dimension 'version'
}
Staging {
dimension 'version'
}
}
}
and you can not define unique field for Brand2Staging
flavors. But with porflavor plugin you can!
Add porflavor plugin:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.nikialeksey:porflavor-gradle-plugin:<latest>"
}
}
And then apply it:
apply plugin 'com.android.application'
apply plugin: 'com.nikialeksey.porflavor'
android {
flavorDimensions 'brand', 'version'
productFlavors {
Brand1 {
dimension 'brand'
}
Brand2 {
dimension 'brand'
}
Brand3 {
dimension 'brand'
}
Store {
dimension 'version'
}
Staging {
dimension 'version'
}
}
porflavor {
Brand1Store {
buildConfigField "boolean", "fooFeatureEnabled", "false"
resValue "string", "appName", "App"
}
Brand1Staging {
buildConfigField "boolean", "fooFeatureEnabled", "false"
resValue "string", "appName", "App Staging"
}
}
}