Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Fix JaCoCo error #267

Merged
merged 3 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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