Skip to content

Commit

Permalink
Feature/jacoco (#7)
Browse files Browse the repository at this point in the history
* Update build.gradle

* Update .travis.yml
  • Loading branch information
felixklauke committed Sep 18, 2018
1 parent 09e0055 commit 576c1a8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Expand Up @@ -20,3 +20,10 @@ notifications:
###########################
script:
- ./gradlew build check
- ./gradlew codeCoverageReport

###################################
### Upload Code Coverage Report ###
###################################
after_success:
- bash <(curl -s https://codecov.io/bash)
23 changes: 23 additions & 0 deletions build.gradle
Expand Up @@ -10,6 +10,7 @@ allprojects {

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'jacoco'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -64,3 +65,25 @@ allprojects {
useJUnitPlatform()
}
}

task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")

// Add all relevant sourcesets from the subprojects
subprojects.each {
sourceSets it.sourceSets.main
}

reports {
xml.enabled = true
xml.setDestination(new File("${buildDir}/reports/jacoco/report.xml"))
html.setEnabled(true)
html.setDestination(new File("${buildDir}/reports/jacoco/report.html"))
}

dependencies {
subprojects {
test
}
}
}

0 comments on commit 576c1a8

Please sign in to comment.