org.gradle.testing.jacoco.tasks

## Class JacocoReport

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.testing.jacoco.tasks.JacocoBase
      - - org.gradle.testing.jacoco.tasks.JacocoReport

- All Implemented Interfaces:
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Reporting<JacocoReportsContainer>, Task, org.gradle.util.Configurable<Task>

      @CacheableTask
      @Incubating
      public class JacocoReport
      extends JacocoBase
      implements Reporting<JacocoReportsContainer>

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JacocoReport()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `additionalClassDirs(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(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(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` | `getAdditionalClassDirs()` Additional class dirs that coverage data should be reported for.
    `FileCollection` | `getAdditionalSourceDirs()` Additional source dirs for the classes coverage data is being reported for.
    `FileCollection` | `getAllClassDirs()` Gets the class directories that coverage will be reported for.
    `FileCollection` | `getAllSourceDirs()` Gets the source directories for the classes that will be reported on.
    `protected org.gradle.api.internal.project.IsolatedAntBuilder` | `getAntBuilder()`
    `FileCollection` | `getClassDirectories()` Source sets that coverage should be reported for.
    `FileCollection` | `getExecutionData()` Collection of execution data files to analyze.
    `protected org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `JacocoReportsContainer` | `getReports()` Returns the reports to be generated by this task.
    `FileCollection` | `getSourceDirectories()` Source sets that coverage should be reported for.
    `JacocoReportsContainer` | `reports(Action<? super JacocoReportsContainer> configureAction)` Allow configuration of the report container by closure.
    `JacocoReportsContainer` | `reports(Closure closure)` Configures the reports to be generated by this task.
    `void` | `setAdditionalClassDirs(FileCollection additionalClassDirs)`
    `void` | `setAdditionalSourceDirs(FileCollection additionalSourceDirs)`
    `void` | `setClassDirectories(FileCollection classDirectories)`
    `void` | `setExecutionData(FileCollection executionData)`
    `void` | `setSourceDirectories(FileCollection sourceDirectories)`
    `void` | `sourceSets(SourceSet... sourceSets)` Adds a source set to the list to be reported on.

    - ### Methods inherited from class org.gradle.testing.jacoco.tasks.JacocoBase

      `getJacocoClasspath, setJacocoClasspath`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JacocoReport

          public JacocoReport()

  - ### Method Detail

    - #### getInstantiator

          @Inject
          protected org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### getAntBuilder

          @Inject
          protected org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()

    - #### getReports

          public JacocoReportsContainer getReports()

      Returns the reports to be generated by this task.
      Specified by:
        `getReports` in interface `Reporting<JacocoReportsContainer>`
      Returns:
        The report container

    - #### reports

          public JacocoReportsContainer reports(Closure closure)

      Configures the reports to be generated by this task.
      Specified by:
        `reports` in interface `Reporting<JacocoReportsContainer>`
      Parameters:
        `closure` - The configuration
      Returns:
        The report container

    - #### reports

          public JacocoReportsContainer reports(Action<? super JacocoReportsContainer> configureAction)

      Description copied from interface: `Reporting`
      Allow configuration of the report container by closure.

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

      Specified by:
        `reports` in interface `Reporting<JacocoReportsContainer>`
      Parameters:
        `configureAction` - The configuration
      Returns:
        The report container

    - #### getExecutionData

          @PathSensitive(value=NONE)
          @InputFiles
          public FileCollection getExecutionData()

      Collection of execution data files to analyze.

    - #### setExecutionData

          public void setExecutionData(FileCollection executionData)

    - #### getSourceDirectories

          @PathSensitive(value=RELATIVE)
          @InputFiles
          public FileCollection getSourceDirectories()

      Source sets that coverage should be reported for.

    - #### setSourceDirectories

          public void setSourceDirectories(FileCollection sourceDirectories)

    - #### getClassDirectories

          @PathSensitive(value=RELATIVE)
          @InputFiles
          public FileCollection getClassDirectories()

      Source sets that coverage should be reported for.

    - #### setClassDirectories

          public void setClassDirectories(FileCollection classDirectories)

    - #### getAdditionalClassDirs

          @Optional
          @PathSensitive(value=RELATIVE)
          @InputFiles
          public FileCollection getAdditionalClassDirs()

      Additional class dirs that coverage data should be reported for.

    - #### setAdditionalClassDirs

          public void setAdditionalClassDirs(FileCollection additionalClassDirs)

    - #### getAdditionalSourceDirs

          @Optional
          @PathSensitive(value=RELATIVE)
          @InputFiles
          public FileCollection getAdditionalSourceDirs()

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

    - #### setAdditionalSourceDirs

          public void setAdditionalSourceDirs(FileCollection additionalSourceDirs)

    - #### generate

          public void generate()

    - #### executionData

          public void executionData(Object... files)

      Adds execution data files to be used during coverage analysis.
      Parameters:
        `files` - one or more files to add

    - #### executionData

          public 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

          public 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

    - #### getAllClassDirs

          @Internal
          public FileCollection getAllClassDirs()

      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

    - #### getAllSourceDirs

          @Internal
          public FileCollection getAllSourceDirs()

      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:
        `getAllClassDirs()`

    - #### sourceSets

          public 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

    - #### additionalClassDirs

          public void additionalClassDirs(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

          public 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

          public void additionalSourceDirs(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

          public 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