Created
January 3, 2018 17:35
-
-
Save luongvo/1b8c2913358362a7f30cfa900ea5d24d to your computer and use it in GitHub Desktop.
Aggregated Jacoco reports in a multi-project Gradle build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
apply plugin: 'java' | |
apply plugin: 'jacoco' | |
repositories { | |
jcenter() | |
} | |
jacoco { | |
toolVersion = '0.7.1.201405082137' | |
} | |
} | |
subprojects { | |
dependencies { | |
testCompile 'junit:junit:4.11' | |
} | |
jacocoTestReport { | |
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs) | |
sourceDirectories = files(sourceSets.main.allSource.srcDirs) | |
classDirectories = files(sourceSets.main.output) | |
reports { | |
html.enabled = true | |
xml.enabled = true | |
csv.enabled = false | |
} | |
} | |
} | |
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { | |
dependsOn = subprojects.test | |
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) | |
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) | |
classDirectories = files(subprojects.sourceSets.main.output) | |
executionData = files(subprojects.jacocoTestReport.executionData) | |
reports { | |
html.enabled = true | |
xml.enabled = true | |
csv.enabled = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment