diff --git a/build.gradle b/build.gradle index 6fd32e27..0c1142bb 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' - classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+' + classpath 'com.github.jcandksolutions.gradle:android-unit-test:2.1.1' } } diff --git a/stetho-okhttp/build.gradle b/stetho-okhttp/build.gradle index 06f16fe2..4d06ee1a 100644 --- a/stetho-okhttp/build.gradle +++ b/stetho-okhttp/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'robolectric' android { compileSdkVersion 21 @@ -10,12 +9,7 @@ android { targetSdkVersion 21 versionCode 1 versionName "1.0" - } - - sourceSets { - androidTest { - setRoot('src/test') - } + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { @@ -26,10 +20,7 @@ android { } } -robolectric { - include '**/*Test.class' - exclude '**/espresso/**/*.class' -} +apply plugin: 'android-unit-test' dependencies { compile project(':stetho') @@ -37,19 +28,19 @@ dependencies { //noinspection GradleDynamicVersion compile 'com.squareup.okhttp:okhttp:[2,3)' - androidTestCompile 'junit:junit:4.12' - androidTestCompile('org.robolectric:robolectric:2.4') { + testCompile 'junit:junit:4.12' + testCompile('org.robolectric:robolectric:2.4') { exclude module: 'commons-logging' exclude module: 'httpclient' } - androidTestCompile 'org.powermock:powermock-api-mockito:1.6.1' - androidTestCompile 'org.powermock:powermock-module-junit4:1.6.1' + testCompile 'org.powermock:powermock-api-mockito:1.6.1' + testCompile 'org.powermock:powermock-module-junit4:1.6.1' // Needed for Robolectric and PowerMock to be combined in a single test. - androidTestCompile 'org.powermock:powermock-module-junit4-rule:1.6.1' - androidTestCompile 'org.powermock:powermock-classloading-xstream:1.6.1' + testCompile 'org.powermock:powermock-module-junit4-rule:1.6.1' + testCompile 'org.powermock:powermock-classloading-xstream:1.6.1' - androidTestCompile 'com.squareup.okhttp:mockwebserver:2.2.0' + testCompile 'com.squareup.okhttp:mockwebserver:2.2.0' } apply from: rootProject.file('release.gradle') diff --git a/stetho/build.gradle b/stetho/build.gradle index 84335848..908d76d2 100644 --- a/stetho/build.gradle +++ b/stetho/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'robolectric' android { compileSdkVersion 21 @@ -10,31 +9,23 @@ android { targetSdkVersion 21 versionCode 1 versionName "1.0" - } - - sourceSets { - androidTest { - setRoot('src/test') - } + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } -robolectric { - include '**/*Test.class' - exclude '**/espresso/**/*.class' -} +apply plugin: 'android-unit-test' dependencies { compile 'commons-cli:commons-cli:1.2' compile 'com.google.code.findbugs:jsr305:2.0.1' - androidTestCompile 'junit:junit:4.12' - androidTestCompile('org.robolectric:robolectric:2.4') { + testCompile 'junit:junit:4.12' + testCompile('org.robolectric:robolectric:2.4') { exclude module: 'commons-logging' exclude module: 'httpclient' } - androidTestCompile 'org.powermock:powermock-api-mockito:1.6.1' - androidTestCompile 'org.powermock:powermock-module-junit4:1.6.1' + testCompile 'org.powermock:powermock-api-mockito:1.6.1' + testCompile 'org.powermock:powermock-module-junit4:1.6.1' } apply from: rootProject.file('release.gradle')