Test Source Directories for Multi Dimension Flavors not recognized in Android Studio -
i have issue test , androidtest source directories multi-dimension flavors.
given following flavors:
flavordimensions "taste", "serving" productflavors { chocolate { flavordimension "taste" } strawberry { flavordimension "taste" } kiwi { flavordimension "taste" } sample { flavordimension "serving" } whole { flavordimension "serving" } }
there no issues "non-test" source directories (of 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 "test" source directories.
only single dimension flavors recognized: src/testsample, src/testwhole, src/testchocolate, src/teststrawberry, src/testkiwi.
multi-dimension flavors not: src/testchocolatesample, src/testchocolatewhole, src/teststrawberrysample, src/teststrawberrywhole, src/testkiwisample, src/testkiwiwhole
this case "androidtest" equivalent source directories.
i under impression app.iml not correctly generated. while understanding should never this, folders correctly recognized if manually add in missing entries.
why should work non-test source directories fail test source directories? known issue or limitation gradle plugin?
i tried researching this, found topics related single flavor dimensions test source folders or mult-dimension flavors non-test source folders. there nothing regards multi-dimension flavors test source folders.
you should able fix modifying android app build.gradle
file. example, add testchocolatesample
unit tests , testchocolate
android integration tests:
android { [...] sourcesets { main.java.srcdirs += 'src/main/java' testchocolatesample.java.srcdirs += 'src/testchocolatesample/java' androidtestchocolate.java.srcdirs += 'src/androidtestchocolate/java' } }
this works kotlin. switch java
kotlin
.
Comments
Post a Comment