Reputation: 255
flavorDimensions("color")
productFlavors {
register("red") {
setDimension("color")
}
register("blue") {
setDimension("color")
}
}
redImplementation("red library")
blueImplementation("blue library")
This generates the build variants: blueDebug, blueRelease, redDebug, redRelease
But in addition to these i want a build variant that is a combination of these two so the final list will be: blueDebug, blueRelease, redDebug, redRelease, blueRedDebug, blueRedRelease
If you have them in different flavordimensions you end up with just the blueRed combination.
How do i setup my gradle script to support this case? The end goal is to able to choose if you want just the red library, just the blue library or the combination of both.
Upvotes: 0
Views: 259
Reputation: 38243
Since you already have the blue
and red
library modules, your app can have these flavors:
blue
, which depends on blue
libraryred
, which depends on red
libraryblueRed
, which depends on blue
and red
librariesI'm assuming that blue
and red
libraries can be included side by side.
flavorDimensions("color")
productFlavors {
register("red") {
setDimension("color")
}
register("blue") {
setDimension("color")
}
register("blueRed") {
setDimension("color")
}
}
redImplementation("red library")
blueImplementation("blue library")
blueRedImplementation("red library")
blueRedImplementation("blue library")
Upvotes: 2
Reputation: 5257
I don't think this is possible with flavors. I can recommend you to read this article to know more about flavors.
And have a look at the doc
Upvotes: 0