api / org.gradle.testing.jacoco.plugins / JacocoPluginExtension

JacocoPluginExtension

@Incubating open class JacocoPluginExtension

Extension including common properties and methods for Jacoco.

Constructors

<init>

JacocoPluginExtension(project: Project, agent: JacocoAgentJar)

Creates a Jacoco plugin extension.

Properties

TASK_EXTENSION_NAME

static val TASK_EXTENSION_NAME: String

Functions

applyTo

open fun <T> applyTo(task: T): Unit where T : Task, T : JavaForkOptions

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.

open fun <T> applyTo(tasks: TaskCollection<T>): Unit where T : Task, T : JavaForkOptions

Applies Jacoco to all of the given tasks.

getReportsDir

open fun getReportsDir(): File

The directory where reports will be generated.

getToolVersion

open fun getToolVersion(): String

Version of Jacoco JARs to use.

setReportsDir

open fun setReportsDir(reportsDir: Provider<File>): Unit

Set the provider for calculating the report directory.

open fun setReportsDir(reportsDir: File): Unit

setToolVersion

open fun setToolVersion(toolVersion: String): Unit

Extension Properties

ext

val JacocoPluginExtension.ext: ExtraPropertiesExtension

Retrieves the ext extension.

Extension Functions

ext

fun JacocoPluginExtension.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit

Configures the ext extension.