I have an issue with test and androidTest source directories for multi-dimension flavors.
Given the following flavors:
flavorDimensions "taste", "serving"
productFlavors {
chocolate {
flavorDimension "taste"
}
strawberry {
flavorDimension "taste"
}
kiwi {
flavorDimension "taste"
}
sample {
flavorDimension "serving"
}
whole {
flavorDimension "serving"
}
}
There are no issues with "non-test" source directories (of any flavor combination) being recognized in Android Studio:
src/sample, src/whole, src/chocolate, src/strawberry, src/kiwi, src/chocolateSample, src/chocolateWhole, src/strawberrySample, src/strawberryWhole, src/kiwiSample, src/kiwiWhole
My issue is with "test" source directories.
Only single dimension flavors are recognized: src/testSample, src/testWhole, src/testChocolate, src/testStrawberry, src/testKiwi.
Multi-Dimension flavors are not: src/testChocolateSample, src/testChocolateWhole, src/testStrawberrySample, src/testStrawberryWhole, src/testKiwiSample, src/testKiwiWhole
This is also the case for the "androidTest" equivalent source directories.
I am under the impression that it is the app.iml which is not correctly generated. While understanding that we should NEVER do this, the folders are correctly recognized if I were to manually add in the missing entries.
Why should this work with non-test source directories but fail with test source directories? Is this a known issue or a limitation by the gradle plugin?
I tried researching this, but only found topics related single flavor dimensions for test source folders or mult-dimension flavors for non-test source folders. There is nothing with regards to multi-dimension flavors for test source folders.