org.gradle.testing.jacoco.plugins

## Class JacocoPluginExtension

- java.lang.Object
- - groovy.lang.GroovyObjectSupport
  - - org.gradle.testing.jacoco.plugins.JacocoPluginExtension

- All Implemented Interfaces:
    GroovyObject

      @Incubating
      public class JacocoPluginExtension
      extends GroovyObjectSupport

  Extension including common properties and methods for Jacoco.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Project` | `project`
    `static String` | `TASK_EXTENSION_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JacocoPluginExtension(Project project, org.gradle.internal.jacoco.JacocoAgentJar agent)` Creates a Jacoco plugin extension.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T extends Task & JavaForkOptions> void` | `applyTo(T task)` Applies Jacoco to the given task.
    `<T extends Task & JavaForkOptions> void` | `applyTo(TaskCollection tasks)` Applies Jacoco to all of the given tasks.
    `Logger` | `getLogger()` Deprecated. logger should be considered final.
    `File` | `getReportsDir()` The directory where reports will be generated.
    `static String` | `getTASK_EXTENSION_NAME()`
    `String` | `getToolVersion()` Version of Jacoco JARs to use.
    `void` | `setLogger(Logger logger)` Deprecated. logger should be considered final.
    `void` | `setReportsDir(File reportsDir)`
    `void` | `setToolVersion(String toolVersion)`

    - ### Methods inherited from class groovy.lang.GroovyObjectSupport

      `getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty`

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

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

- - ### Field Detail

    - #### TASK_EXTENSION_NAME

          public static final String TASK_EXTENSION_NAME

      See Also:
        Constant Field Values

    - #### project

          protected final Project project

  - ### Constructor Detail

    - #### JacocoPluginExtension

          public JacocoPluginExtension(Project project,
                               org.gradle.internal.jacoco.JacocoAgentJar agent)

      Creates a Jacoco plugin extension.
      Parameters:
        `project` - the project the extension is attached to
        `agent` - the agent JAR to be used by Jacoco

  - ### Method Detail

    - #### getToolVersion

          public String getToolVersion()

      Version of Jacoco JARs to use.

    - #### setToolVersion

          public void setToolVersion(String toolVersion)

    - #### getReportsDir

          public File getReportsDir()

      The directory where reports will be generated.

    - #### setReportsDir

          public void setReportsDir(File reportsDir)

    - #### applyTo

          public <T extends Task & JavaForkOptions> void applyTo(T task)

      Applies Jacoco to the given task. Configuration options will be provided on a task extension named 'jacoco'. Jacoco will be run as an agent during the execution of the task.
      Parameters:
        `task` - the task to apply Jacoco to.
      See Also:
        `TASK_EXTENSION_NAME`

    - #### applyTo

          public <T extends Task & JavaForkOptions> void applyTo(TaskCollection tasks)

      Applies Jacoco to all of the given tasks.
      Parameters:
        `tasks` - the tasks to apply Jacoco to

    - #### getLogger

          @Deprecated
          public Logger getLogger()

      Deprecated. logger should be considered final.
      Logger

    - #### setLogger

          @Deprecated
          public void setLogger(Logger logger)

      Deprecated. logger should be considered final.
      Logger

    - #### getTASK_EXTENSION_NAME

          public static String getTASK_EXTENSION_NAME()