Skip to content

Commit

Permalink
Use vanilla Jacoco and re-enable Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
colintheshots committed Aug 31, 2018
1 parent 676bce1 commit 01406e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: "com.github.spotbugs"
apply plugin: 'jacoco'
apply plugin: 'jacoco-android'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'kotlin-android-extensions'
Expand Down Expand Up @@ -499,13 +498,27 @@ afterEvaluate {
if (project.hasProperty("coverage")) {
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
doLast { jacocoTestReport.execute() }
}

jacocoAndroidUnitTestReport {
csv.enabled false
html.enabled true
xml.enabled true
android.applicationVariants.all { variant ->
task "jacoco${variant.name.capitalize()}TestReport"(type: JacocoReport,
dependsOn: ["test${variant.name.capitalize()}UnitTest"]) {

reports {
html.enabled true
xml.enabled true
}

def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*',
'**/*Test*.*', 'android/**/*.*', '**/*$[0-9].*']
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/${variant.name}", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
"jacoco/test${variant.name.capitalize()}UnitTest.exec", 'outputs/code-coverage/connected/*coverage.ec'
])
}
}

android {
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage:
if_not_found: success
patch:
default:
enabled: no
enabled: yes
threshold: 0.1
if_not_found: success
changes:
Expand Down

0 comments on commit 01406e7

Please sign in to comment.