Provides a gradle interface for generating a jacoco report.
buildscript {
dependencies {
classpath 'com.github.abirmingham:gradle-jacoco-plugin:1.3'
}
}
apply plugin: 'jacoco'
jacoco {
// note that no configuration is required
tmpDir = "${buildDir}/tmp/jacoco"
reportDir = "${project.reporting.baseDir.absolutePath}/jacoco"
excludes = ["**/*Controller", "com/mycompany/util/MyUntestableClass"]
}
Assuming reportDir is unchanged:
open ./build/reports/jacoco/index.html
Ant is used to instrument the test task (org.jacoco.ant.AgentTask), and to generate the report (org.jacoco.ant.ReportTask). Heavily influenced by gschmidl/jacoco-gradle.