0

I Have a requirement to execute android test cases for each build type. So "androidTest.java.srcDirs" will have different values for each build type.

For buildType 1 :

androidTest.java.srcDirs = ['tests/intrumentation1']

For buildType 2 :

androidTest.java.srcDirs = ['tests/intrumentation2']

I don't want to use flavours here for different reasons. debug { androidTest.java.srcDirs = ['tests/debug'] } alpha { androidTest.java.srcDirs = ['tests/alpha'] } In this case first one is always overridden by the next.

Any idea how to declare it for each buildType so that it should not override by the other.

Gabriele Mariotti
  • 192,671
  • 57
  • 469
  • 489

1 Answers1

0

You can simply use different folders for each buildType or flavors

  • For flavor1

    Location src/androidTestFlavor1/

  • For flavor2

    Location src/androidTestFlavor2/

  • For Debug

    Location src/androidTestDebug/

  • For Alpha

    Location src/androidTestAlpha/

Gabriele Mariotti
  • 192,671
  • 57
  • 469
  • 489