I have two dimensions of an app, call then green and blue. There will only be these two dimensions but an unlimited number of product flavors. This is the way I'm setting it up in gradle
flavorDimensions "green", "blue"
productFlavors {
one {
applicationId "com.app.green.one"
versionCode 1
versionName "1.0.0.1";
flavorDimension = "green"
}
two {
applicationId "com.app.blue.two"
versionCode 6
versionName "1.0.1";
flavorDimension = "blue"
}
}
But then after i sync gradle, in the build variants tab all I see is oneTwoDebug and oneTwoRelease, where I should see greenOneDebug greenOneRelease, blueTwoDebug, blueTwoRelease
In theory I want to extend it to be something like this
one {
applicationId "com.app.green.one"
versionCode 1
versionName "1.0.0.1";
flavorDimension = "green"
}
two {
applicationId "com.app.blue.two"
versionCode 6
versionName "1.0.1";
flavorDimension = "blue"
}
three {
applicationId "com.app.green.three"
versionCode 1
versionName "1.0.0.1";
flavorDimension = "green"
}
four {
applicationId "com.app.blue.four"
versionCode 6
versionName "1.0.1";
flavorDimension = "blue"
}
In this case dimensions represent the "type" of app, and then the flavors are more for organizations which can be added.
**EDIT I had the wrong set up for gradle as pointed out here is a more accurate depiction of what I have
flavorDimensions "type", "organization"
productFlavors {
blue {
applicationId "com.app.blue"
flavorDimension = "type"
versionCode 6
versionName "1.0.1";
}
red {
applicationId "com.app.red"
flavorDimension = "type"
versionCode 1
versionName "1.0.0.1";
}
company1 {
flavorDimension = "organization"
}
company2 {
flavorDimension = "organization"
}
}
So far this works, So I can create java source directories for toggling types, but what if I want organization specific config files, do I create java source dirs for each organization as well?