Created
January 14, 2021 22:57
-
-
Save ChinW/afb3667e303fd95e24ea4501f2e29cc8 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
| // **************************************************************************** | |
| // The `org.kordamp.gradle.jacoco` plugin takes care of mane aspects shown here | |
| // http://kordamp.org/kordamp-gradle-plugins/#_org_kordamp_gradle_jacoco | |
| // | |
| // The code shown here is obsolete. Use it at your own risk | |
| // **************************************************************************** | |
| 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