@@ -36,13 +36,16 @@ android {
3636 minSdkVersion project. androidMinSdkVersion
3737 targetSdkVersion project. androidTargetSdkVersion
3838 vectorDrawables. useSupportLibrary = true
39-
4039 }
40+
4141 buildTypes {
4242 release {
4343 minifyEnabled false
4444 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
4545 }
46+ debug {
47+ testCoverageEnabled true
48+ }
4649 }
4750
4851 testOptions {
@@ -52,26 +55,29 @@ android {
5255 includeNoLocationClasses = true
5356 }
5457 }
58+ // fixes https://github.com/robolectric/robolectric/issues/3169#issuecomment-312046322
59+ unitTests. includeAndroidResources = true
5560 }
5661
5762 lintOptions {
5863 warningsAsErrors true
64+ disable ' RequiredSize' , ' ClickableViewAccessibility'
5965 }
6066}
6167
6268dependencies {
63- compile " com.android.support:appcompat-v7:$androidSupportLibraryVersion "
69+ api " com.android.support:appcompat-v7:$androidSupportLibraryVersion "
6470
65- testCompile " junit:junit:$junitVersion "
66- testCompile " org.mockito:mockito-core:$mockitoVersion "
67- testCompile " com.squareup.assertj:assertj-android:$assertjVersion "
68- testCompile (" org.robolectric:robolectric:$robolectricVersion " ) {
71+ testImplementation " junit:junit:$junitVersion "
72+ testImplementation " org.mockito:mockito-core:$mockitoVersion "
73+ testImplementation " com.squareup.assertj:assertj-android:$assertjVersion "
74+ testImplementation (" org.robolectric:robolectric:$robolectricVersion " ) {
6975 exclude group : ' commons-logging' , module : ' commons-logging'
7076 exclude group : ' org.apache.httpcomponents' , module : ' httpclient'
7177 }
72- testCompile " org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion "
73- testCompile " org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion "
74- testCompile " com.nhaarman:mockito-kotlin:$mockitoKotlinVersion "
78+ testImplementation " org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion "
79+ testImplementation " org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion "
80+ testImplementation " com.nhaarman:mockito-kotlin:$mockitoKotlinVersion "
7581}
7682
7783gradle. taskGraph. beforeTask { Task task ->
@@ -85,11 +91,13 @@ gradle.taskGraph.beforeTask { Task task ->
8591}
8692
8793// Log out test results to console
88- tasks. matching { it instanceof Test }. all {
94+ tasks. matching { it instanceof Test }. all {
8995 testLogging. events = [" failed" , " passed" , " skipped" ]
9096}
9197
92- check. dependsOn ' checkstyle' , ' findbugs' , ' pmd' , ' jacocoTestReport'
98+ task (' checkWithCoverage' ) {
99+ dependsOn ' checkstyle' , ' findbugs' , ' pmd' , ' jacocoTestReport' , ' lintDebug'
100+ }
93101
94102apply from : ' ../installv1.gradle'
95103apply from : ' ../bintrayv1.gradle'
0 commit comments