Groovy Documentation

org.ajoberstar.gradle.jacoco.tasks
[Groovy] Class JacocoReport

java.lang.Object
  org.gradle.api.DefaultTask
      org.ajoberstar.gradle.jacoco.tasks.JacocoBase
          org.ajoberstar.gradle.jacoco.tasks.JacocoReport

class JacocoReport
extends JacocoBase

Task to generate HTML reports of Jacoco coverage data.


Property Summary
FileCollection additionalClassDirs

Additional class dirs that coverage data should be reported for.

FileCollection additionalSourceDirs

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

java.lang.Object destPath

Path to write report to.

FileCollection executionData

Collection of execution data files to analyze.

java.util.Set sourceSets

Source sets that coverage should be reported for.

 
Method Summary
void additionalClassDirs(java.io.File... dirs)

Adds additional class directories to those that will be included in the report.

void additionalClassDirs(FileCollection dirs)

Adds additional class directories to those that will be included in the report.

void additionalSourceDirs(java.io.File... dirs)

Adds additional source directories to be used for any classes included in the report.

void additionalSourceDirs(FileCollection dirs)

Adds additional source directories to be used for any classes included in the report.

void executionData(java.lang.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.

void executionData(TaskCollection tasks)

Adds execution data generated by the given tasks to the list of those used during coverage analysis.

void generate()

FileCollection getClassDirs()

Gets the class directories that coverage will be reported for.

java.io.File getDestDir()

Gets the directory to write the report to.

FileCollection getSourceDirs()

Gets the source directories for the classes that will be reported on.

void sourceSets(SourceSet... sourceSets)

Adds a source set to the list to be reported on.

 

Property Detail

additionalClassDirs

FileCollection additionalClassDirs
Additional class dirs that coverage data should be reported for.


additionalSourceDirs

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


destPath

java.lang.Object destPath
Path to write report to. Defaults to build/reports/jacoco/.


executionData

@InputFiles
FileCollection executionData
Collection of execution data files to analyze.


sourceSets

java.util.Set sourceSets
Source sets that coverage should be reported for.


 
Method Detail

additionalClassDirs

void additionalClassDirs(java.io.File... dirs)
Adds additional class directories to those that will be included in the report.
Parameters:
dirs - one or more directories containing classes to report coverage of


additionalClassDirs

void additionalClassDirs(FileCollection dirs)
Adds additional class directories to those that will be included in the report.
Parameters:
dirs - a FileCollection of directories containing classes to report coverage of


additionalSourceDirs

void additionalSourceDirs(java.io.File... dirs)
Adds additional source directories to be used for any classes included in the report.
Parameters:
dirs - one or more directories containing source files for the classes included in the report


additionalSourceDirs

void additionalSourceDirs(FileCollection dirs)
Adds additional source directories to be used for any classes included in the report.
Parameters:
dirs - a FileCollection of directories containing source files for the classes included in the report


executionData

void executionData(java.lang.Object... files)
Adds execution data files to be used during coverage analysis.
Parameters:
files - one or more files to add


executionData

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.
Parameters:
tasks - one or more tasks to add


executionData

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.
Parameters:
tasks - one or more tasks to add


generate

@TaskAction
void generate()


getClassDirs

@InputFiles
FileCollection getClassDirs()
Gets the class directories that coverage will be reported for. All classes in these directories will be included in the report.
Returns:
class dirs to report coverage of


getDestDir

@OutputDirectory
java.io.File getDestDir()
Gets the directory to write the report to.


getSourceDirs

@InputFiles
FileCollection getSourceDirs()
Gets the source directories for the classes that will be reported on. Source will be obtained from these directories only for the classes included in the report.
Returns:
source directories for the classes reported on
See Also:
getClassDirs()


sourceSets

void sourceSets(SourceSet... sourceSets)
Adds a source set to the list to be reported on. The output of this source set will be used as classes to include in the report. The source for this source set will be used for any classes included in the report.
Parameters:
sourceSets - one or more source sets to report on


 

Groovy Documentation