Skip to content

Commit

Permalink
Fix JaCoCo error (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtstern committed Dec 21, 2018
2 parents d5db1da + 99490ca commit d5b707c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android:
- tools

before_script: echo y | ${ANDROID_HOME}tools/bin/sdkmanager --channel=3 "tools" "platform-tools" "platforms;android-27"
script: ./gradlew build jacocoTestReport :easypermissions:test
script: ./gradlew build jacocoTestReportRelease :easypermissions:test

after_failure:
- cat app/build/reports/tests/testDebugUnitTest/index.html
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ buildscript {
repositories {
jcenter()
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.3'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.13.0'
}
}

Expand Down
17 changes: 8 additions & 9 deletions easypermissions/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'jacoco-android'
apply plugin: "com.vanniktech.android.junit.jacoco"

android {
compileSdkVersion compileSdk
Expand Down Expand Up @@ -28,21 +28,20 @@ android {
}
}

junitJacoco {
includeNoLocationClasses = true
}

dependencies {
api "com.android.support:appcompat-v7:$support_library_version"
api "com.android.support:support-compat:$support_library_version"
api "com.android.support:support-fragment:$support_library_version"

testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.42'
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation 'org.robolectric:shadows-supportv4:3.8'
testImplementation 'org.mockito:mockito-core:2.18.0'
}

// Needed in order to process Robolectric tests when running JaCoCo
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
testImplementation 'org.robolectric:robolectric:4.1'
testImplementation 'org.robolectric:shadows-supportv4:4.1'
testImplementation 'org.mockito:mockito-core:2.23.4'
}

apply from: 'bintray.gradle'
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true

# Configure on demand
org.gradle.configureondemand=true
org.gradle.configureondemand=true

# Required by Robolectric 4.x
android.enableUnitTestBinaryResources=true

0 comments on commit d5b707c

Please sign in to comment.