# JacocoTaskExtension

abstract class JacocoTaskExtension(source)

Extension for tasks that should run with a Jacoco agent to generate coverage execution data.

## Constructors

JacocoTaskExtension
Link copied to clipboard
@Inject
constructor(objects: ObjectFactory, agent: JacocoAgentJar, task: JavaForkOptions)
Creates a Jacoco task extension.

## Types

Output
Link copied to clipboard
enum Output
The types of output that the agent can use for execution data.

## Properties

address
Link copied to clipboard
@get: Nullable
@get: Optional
@get: Input
open var address: String
classDumpDir
Link copied to clipboard
@get: Nullable
@get: Optional
@get: LocalState
open var classDumpDir: File
excludeClassLoaders
Link copied to clipboard
@get: Nullable
@get: Optional
@get: Input
open var excludeClassLoaders: List<String>
excludes
Link copied to clipboard
@get: Nullable
@get: Optional
@get: Input
open var excludes: List<String>
includes
Link copied to clipboard
@get: Nullable
@get: Optional
@get: Input
open var includes: List<String>
output
Link copied to clipboard
@get: Input
open var output: JacocoTaskExtension.Output
port
Link copied to clipboard
@get: Input
open var port: Int
sessionId
Link copied to clipboard
@get: Nullable
@get: Optional
@get: Input
open var sessionId: String

## Functions

getAgentClasspath
Link copied to clipboard
@Classpath
open fun getAgentClasspath(): FileCollection
The Jacoco agent classpath.
getAsJvmArg
Link copied to clipboard
@Internal
open fun getAsJvmArg(): String
Gets all properties in the format expected of the agent JVM argument.
getDestinationFile
Link copied to clipboard
@Nullable
@Optional
@OutputFile
open fun getDestinationFile(): File
The path for the execution data to be written to.
isDumpOnExit
Link copied to clipboard
@Input
open fun isDumpOnExit(): Boolean
Whether or not to dump the coverage data at VM shutdown.
isEnabled
Link copied to clipboard
@Input
open fun isEnabled(): Boolean
Whether or not the task should generate execution data.
isIncludeNoLocationClasses
Link copied to clipboard
@Input
open fun isIncludeNoLocationClasses(): Boolean
Whether or not classes without source location should be instrumented.
isJmx
Link copied to clipboard
@Input
open fun isJmx(): Boolean
Whether or not to expose functionality via JMX under `org.jacoco:type=Runtime`.
setDestinationFile
Link copied to clipboard
open fun setDestinationFile(destinationFile: File)
open fun setDestinationFile(destinationFile: Provider<File>)
Set the provider for calculating the destination file.
setDumpOnExit
Link copied to clipboard
open fun setDumpOnExit(dumpOnExit: Boolean)
setEnabled
Link copied to clipboard
open fun setEnabled(enabled: Boolean)
setIncludeNoLocationClasses
Link copied to clipboard
open fun setIncludeNoLocationClasses(includeNoLocationClasses: Boolean)
setJmx
Link copied to clipboard
open fun setJmx(jmx: Boolean)