diff --git a/build.gradle b/build.gradle index 2a001f46..c6d15747 100644 --- a/build.gradle +++ b/build.gradle @@ -22,6 +22,7 @@ allprojects { apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' + apply plugin: 'jacoco' apply plugin: 'checkstyle' // animalsniffer @@ -75,6 +76,19 @@ allprojects { 'git tag --points-at HEAD'.execute().text.trim()) } + jacoco { + toolVersion = "0.8.1" + } + + jacocoTestReport { + dependsOn test + sourceDirectories = project.files(sourceSets.main.allSource.srcDirs) + classDirectories = project.files(sourceSets.main.output) + reports { + xml.enabled true + } + } + } subprojects { @@ -199,6 +213,20 @@ def getGitCommit() { gitCommit } +/* +task jacocoRootReport(type: JacocoReport) { + reports { + xml.enabled true + xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml") + } + // We could remove the following setOnlyIf line, but then + // jacocoRootReport would silently be SKIPPED if something with + // the projectsWithUnitTests is wrong (e.g. a project is missing + // in there). + setOnlyIf { true } +} +*/ + task javadocAll(type: Javadoc) { source subprojects.collect {project -> project.sourceSets.main.allJava }