How to get Android Studio 1.1 to call generateDebugTestSources instead of assembleDebugTest during the "make" command?

I have a project with 1000+ tests that work perfectly with Robolectric. After switching to Android Studio 1.1, when I go to “Run” → “All Tests” during the “Make” command, Android Studio calls Gradle assembleDebugTest instead of generateDebugTestSources .. In my case, this makes the build system to start and remove the APK test, which useless to me as all tests are JVM tests.

I found this change that could cause it:

- if (testCompileType == TestCompileType.ANDROID_TESTS) { + if (testCompileType != TestCompileType.NONE) { String gradleTaskName = properties.ASSEMBLE_TEST_TASK_NAME; if (StringUtil.isNotEmpty(gradleTaskName)) { tasks.add(createBuildTask(gradlePath, gradleTaskName)); 

Is there any way to configure it on Android Studio? Version 1.0 is working fine.

Thanks!

+3
android android-gradle build.gradle gradle
source share
1 answer

If someone is interested in a solution in accordance with the new device testing guide:

http://tools.android.com/tech-docs/unit-testing-support

you need to change the test artifacts to “Unit Testing” as described in step 5. Thus, when you run all the tests, AS will call a new assembleDebugUnitTest task instead of assembleDebugTest .

0
source share

All Articles