Class JacocoPluginExtension
java.lang.Object
org.gradle.testing.jacoco.plugins.JacocoPluginExtension
Extension including common properties and methods for Jacoco.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJacocoPluginExtension
(Project project, org.gradle.internal.jacoco.JacocoAgentJar agent) Creates a Jacoco plugin extension. -
Method Summary
Modifier and TypeMethodDescription<T extends Task & JavaForkOptions>
voidapplyTo
(TaskCollection<T> tasks) Applies Jacoco to all of the given tasks.<T extends Task & JavaForkOptions>
voidapplyTo
(T task) Applies Jacoco to the given task.The directory where reports will be generated.Version of Jacoco JARs to use.void
setReportsDir
(File reportsDir) void
setReportsDir
(Provider<File> reportsDir) Set the provider for calculating the report directory.void
setToolVersion
(String toolVersion)
-
Field Details
-
TASK_EXTENSION_NAME
- See Also:
-
project
-
-
Constructor Details
-
JacocoPluginExtension
Creates a Jacoco plugin extension.- Parameters:
project
- the project the extension is attached toagent
- the agent JAR to be used by Jacoco
-
-
Method Details
-
getToolVersion
Version of Jacoco JARs to use. -
setToolVersion
-
getReportsDir
The directory where reports will be generated. -
setReportsDir
Set the provider for calculating the report directory.- Parameters:
reportsDir
- Reports directory provider- Since:
- 4.0
-
setReportsDir
-
applyTo
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:
-
applyTo
Applies Jacoco to all of the given tasks.- Parameters:
tasks
- the tasks to apply Jacoco to
-