I have two flavors in my gradle file: flavor1 and flavor2. Along with the build types, they create the following build variants:
flavor1-debug
flavor1-release
flavor2-debug
flavor2-debug
Assuming I want to have a different drawable for each variant, where should I put it?
My folder structure is
src
|__ main
|__ flavor1
|__ flavor2
|__ debug
|__ release
I am aware, according to this that
All resources (Android res and assets) are used using overlay priority
where the Build Type overrides the Product Flavor, which overrides the
main sourceSet.
This means however that if I put it in the Build Type folder, then the debug variants will have the same debug drawable and the release variants will have the same release drawable.
I guess I could create more specific flavors from the beginning, e.g. flavor1release, flavor1debug, flavor2release, flavor2debug, but I would end up with 8 variants. I could probably not build some of the build types according to this, but that doesn't seem very clean.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…