I has two flavor dimensions: brand
and version
, my flavors config looks like:
flavorDimensions 'brand', 'version'
Brand1 {
dimension 'brand'
...
}
Brand2 {
dimension 'brand'
...
}
Version1 {
dimension 'version'
...
}
Version2 {
dimension 'version'
...
}
And I want to have four unique buildConfigField
-s (for example HockeyAppId) for every configurations:
How I can do this?
I wrote my own plugin for that purpose: https://github.com/nikialeksey/porflavor, and now I can define such fields:
flavorDimensions 'brand', 'version'
productFlavors {
Brand1 {
dimension 'brand'
...
}
Brand2 {
dimension 'brand'
...
}
Version1 {
dimension 'version'
...
}
Version2 {
dimension 'version'
...
}
}
apply plugin: 'com.nikialeksey.porflavor'
porflavor {
Brand1Version1 {
buildConfigField "boolean", "fooFeatureEnabled", "false"
}
Brand2Version2 {
buildConfigField "boolean", "fooFeatureEnabled", "true"
}
...
}