This is fixed in 1.3, you can try it out with 1.3.0-beta3. It also comes
with a task called :app:sourceSets that prints out all the source sets that
Gradle would recognize. In your case the output look like this.
Additional tip: remember you can use android.variantFilter { ... } to
reduce the number of variants. See the DSL reference and old release notes
<http://tools.android.com/tech-docs/new-build-system> for details.
------------------------------------------------------------
Project :app
------------------------------------------------------------
androidTest
-----------
Compile configuration: androidTestCompile
build.gradle name: android.sourceSets.androidTest
Java sources: [app/src/androidTest/java]
Manifest file: app/src/androidTest/AndroidManifest.xml
Android resources: [app/src/androidTest/res]
Assets: [app/src/androidTest/assets]
AIDL sources: [app/src/androidTest/aidl]
RenderScript sources: [app/src/androidTest/rs]
JNI sources: [app/src/androidTest/jni]
JNI libraries: [app/src/androidTest/jniLibs]
Java-style resources: [app/src/androidTest/resources]
androidTestChocolate
--------------------
Compile configuration: androidTestChocolateCompile
build.gradle name: android.sourceSets.androidTestChocolate
Java sources: [app/src/androidTestChocolate/java]
Manifest file: app/src/androidTestChocolate/AndroidManifest.xml
Android resources: [app/src/androidTestChocolate/res]
Assets: [app/src/androidTestChocolate/assets]
AIDL sources: [app/src/androidTestChocolate/aidl]
RenderScript sources: [app/src/androidTestChocolate/rs]
JNI sources: [app/src/androidTestChocolate/jni]
JNI libraries: [app/src/androidTestChocolate/jniLibs]
Java-style resources: [app/src/androidTestChocolate/resources]
androidTestChocolateSample
--------------------------
Compile configuration: androidTestChocolateSampleCompile
build.gradle name: android.sourceSets.androidTestChocolateSample
Java sources: [app/src/androidTestChocolateSample/java]
Manifest file: app/src/androidTestChocolateSample/AndroidManifest.xml
Android resources: [app/src/androidTestChocolateSample/res]
Assets: [app/src/androidTestChocolateSample/assets]
AIDL sources: [app/src/androidTestChocolateSample/aidl]
RenderScript sources: [app/src/androidTestChocolateSample/rs]
JNI sources: [app/src/androidTestChocolateSample/jni]
JNI libraries: [app/src/androidTestChocolateSample/jniLibs]
Java-style resources: [app/src/androidTestChocolateSample/resources]
// ...
testWhole
---------
Compile configuration: testWholeCompile
build.gradle name: android.sourceSets.testWhole
Java sources: [app/src/testWhole/java]
Java-style resources: [app/src/testWhole/resources]
whole
-----
Compile configuration: wholeCompile
build.gradle name: android.sourceSets.whole
Java sources: [app/src/whole/java]
Manifest file: app/src/whole/AndroidManifest.xml
Android resources: [app/src/whole/res]
Assets: [app/src/whole/assets]
AIDL sources: [app/src/whole/aidl]
RenderScript sources: [app/src/whole/rs]
JNI sources: [app/src/whole/jni]
JNI libraries: [app/src/whole/jniLibs]
Java-style resources: [app/src/whole/resources]
On Monday, June 29, 2015 at 8:17:23 PM UTC+1, [email protected] wrote:
>
> 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.
>
> Thanks,
>
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.