JacocoReport

API Documentation:JacocoReport

Task to generate HTML, Xml and CSV reports of Jacoco coverage data.

Properties

PropertyDescription
additionalClassDirs

Additional class dirs that coverage data should be reported for.

additionalSourceDirs

Additional source dirs for the classes coverage data is being reported for.

classDirectories

Source sets that coverage should be reported for.

executionData

Collection of execution data files to analyze.

jacocoClasspath

Classpath containing Jacoco classes for use by the task.

reports

The reports to be generated by this task.

sourceDirectories

Source sets that coverage should be reported for.

Methods

MethodDescription
executionData(files)

Adds execution data files to be used during coverage analysis.

executionData(tasks)

Adds execution data generated by a task to the list of those used during coverage analysis. Only tasks with a JacocoTaskExtension will be included; all others will be ignored.

executionData(tasks)

Adds execution data generated by the given tasks to the list of those used during coverage analysis. Only tasks with a JacocoTaskExtension will be included; all others will be ignored.

reports(configureAction)

Allow configuration of the report container by closure.

Script blocks

No script blocks

Property details

ConfigurableFileCollection additionalClassDirs

Additional class dirs that coverage data should be reported for.

ConfigurableFileCollection additionalSourceDirs

Additional source dirs for the classes coverage data is being reported for.

Source sets that coverage should be reported for.

Collection of execution data files to analyze.

FileCollection jacocoClasspath

Classpath containing Jacoco classes for use by the task.

Default with jacoco plugin:
project.configurations.jacocoAnt

JacocoReportsContainer reports (read-only)

The reports to be generated by this task.

ConfigurableFileCollection sourceDirectories

Source sets that coverage should be reported for.

Method details

void executionData(Object... files)

Adds execution data files to be used during coverage analysis.

void executionData(Task... tasks)

Adds execution data generated by a task to the list of those used during coverage analysis. Only tasks with a JacocoTaskExtension will be included; all others will be ignored.

void executionData(TaskCollection tasks)

Adds execution data generated by the given tasks to the list of those used during coverage analysis. Only tasks with a JacocoTaskExtension will be included; all others will be ignored.

T reports(Action<? super T> configureAction)

Allow configuration of the report container by closure.

reports {
  html {
    enabled false
  }
  xml.destination "build/reports/myReport.xml"
}