Gradle Jacoco Plugin

A Gradle plugin for Jacoco

License

License

Categories

Categories

Gradle Build Tools JaCoCo Application Testing & Monitoring Code Coverage
GroupId

GroupId

com.github.abirmingham
ArtifactId

ArtifactId

gradle-jacoco-plugin
Last Version

Last Version

1.3
Release Date

Release Date

Type

Type

jar
Description

Description

Gradle Jacoco Plugin
A Gradle plugin for Jacoco
Project URL

Project URL

https://github.com/abirmingham/gradle-jacoco-plugin
Source Code Management

Source Code Management

https://github.com/abirmingham/gradle-jacoco-plugin

Download gradle-jacoco-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.abirmingham/gradle-jacoco-plugin/ -->
<dependency>
    <groupId>com.github.abirmingham</groupId>
    <artifactId>gradle-jacoco-plugin</artifactId>
    <version>1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.abirmingham/gradle-jacoco-plugin/
implementation 'com.github.abirmingham:gradle-jacoco-plugin:1.3'
// https://jarcasting.com/artifacts/com.github.abirmingham/gradle-jacoco-plugin/
implementation ("com.github.abirmingham:gradle-jacoco-plugin:1.3")
'com.github.abirmingham:gradle-jacoco-plugin:jar:1.3'
<dependency org="com.github.abirmingham" name="gradle-jacoco-plugin" rev="1.3">
  <artifact name="gradle-jacoco-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.abirmingham', module='gradle-jacoco-plugin', version='1.3')
)
libraryDependencies += "com.github.abirmingham" % "gradle-jacoco-plugin" % "1.3"
[com.github.abirmingham/gradle-jacoco-plugin "1.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Provides a gradle interface for generating a jacoco report.

Use

buildscript {
    dependencies {
        classpath 'com.github.abirmingham:gradle-jacoco-plugin:1.3'
    }
}

apply plugin: 'jacoco'

Configure

jacoco {
    // note that no configuration is required
    tmpDir    = "${buildDir}/tmp/jacoco"
    reportDir = "${project.reporting.baseDir.absolutePath}/jacoco"
    excludes  = ["**/*Controller", "com/mycompany/util/MyUntestableClass"]
}

Profit

Assuming reportDir is unchanged:

open ./build/reports/jacoco/index.html

Notes

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.

Versions

Version
1.3
1.2
1.1
1.0