Created
November 29, 2019 22:00
-
-
Save edin-m/807619a5ba812f8722ea64e6ac8684df to your computer and use it in GitHub Desktop.
Aggregated Jacoco reports in a multi-project Gradle build
This file contains 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