public abstract class JacocoTaskExtension
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JacocoTaskExtension.Output
The types of output that the agent can use for execution data.
|
| Constructor and Description |
|---|
JacocoTaskExtension(org.gradle.api.model.ObjectFactory objects,
JacocoAgentJar agent,
org.gradle.process.JavaForkOptions task)
Creates a Jacoco task extension.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
asJvmArgs()
Gets all agent properties as JVM arguments.
|
java.lang.String |
getAddress()
IP address or hostname to use with
JacocoTaskExtension.Output.TCP_SERVER or JacocoTaskExtension.Output.TCP_CLIENT. |
org.gradle.api.file.FileCollection |
getAgentClasspath()
The Jacoco agent classpath.
|
java.lang.String |
getAsJvmArg()
Deprecated.
Use
asJvmArgs() instead. |
java.io.File |
getClassDumpDir()
Path to dump all class files the agent sees are dumped to.
|
java.io.File |
getDestinationFile()
The path for the execution data to be written to.
|
java.util.List<java.lang.String> |
getExcludeClassLoaders()
List of classloader names that should be excluded from analysis.
|
java.util.List<java.lang.String> |
getExcludes()
List of class names that should be excluded from analysis.
|
java.util.List<java.lang.String> |
getIncludes()
List of class names that should be included in analysis.
|
org.gradle.api.provider.Property<java.lang.Boolean> |
getOffline()
Whether offline instrumentation will be used.
|
org.gradle.api.file.ConfigurableFileCollection |
getOfflineInstrumentedClasses()
The collection of offline instrumented classes that will be added to the test runtime classpath.
|
JacocoTaskExtension.Output |
getOutput()
The type of output to generate.
|
int |
getPort()
Port to bind to for
JacocoTaskExtension.Output.TCP_SERVER or JacocoTaskExtension.Output.TCP_CLIENT. |
java.lang.String |
getSessionId()
An identifier for the session written to the execution data.
|
boolean |
isDumpOnExit()
Whether or not to dump the coverage data at VM shutdown.
|
boolean |
isEnabled()
Whether or not the task should generate execution data.
|
boolean |
isIncludeNoLocationClasses()
Whether or not classes without source location should be instrumented.
|
boolean |
isJmx()
Whether or not to expose functionality via JMX under
org.jacoco:type=Runtime. |
void |
setAddress(java.lang.String address) |
void |
setClassDumpDir(java.io.File classDumpDir)
Sets path to dump all class files the agent sees are dumped to.
|
void |
setDestinationFile(java.io.File destinationFile) |
void |
setDestinationFile(org.gradle.api.provider.Provider<java.io.File> destinationFile)
Set the provider for calculating the destination file.
|
void |
setDumpOnExit(boolean dumpOnExit) |
void |
setEnabled(boolean enabled) |
void |
setExcludeClassLoaders(java.util.List<java.lang.String> excludeClassLoaders) |
void |
setExcludes(java.util.List<java.lang.String> excludes) |
void |
setIncludeNoLocationClasses(boolean includeNoLocationClasses) |
void |
setIncludes(java.util.List<java.lang.String> includes) |
void |
setJmx(boolean jmx) |
void |
setOutput(JacocoTaskExtension.Output output) |
void |
setPort(int port) |
void |
setSessionId(java.lang.String sessionId) |
@Inject
public JacocoTaskExtension(org.gradle.api.model.ObjectFactory objects,
JacocoAgentJar agent,
org.gradle.process.JavaForkOptions task)
objects - the object factoryagent - the agent JAR to use for analysistask - the task we extend@Input public boolean isEnabled()
true.public void setEnabled(boolean enabled)
@Incubating @Input public org.gradle.api.provider.Property<java.lang.Boolean> getOffline()
false.@Incubating @IgnoreEmptyDirectories @PathSensitive(value=RELATIVE) @InputFiles public org.gradle.api.file.ConfigurableFileCollection getOfflineInstrumentedClasses()
@Nullable @Optional @OutputFile public java.io.File getDestinationFile()
public void setDestinationFile(org.gradle.api.provider.Provider<java.io.File> destinationFile)
destinationFile - Destination file providerpublic void setDestinationFile(java.io.File destinationFile)
@Nullable @Optional @Input public java.util.List<java.lang.String> getIncludes()
public void setIncludes(@Nullable
java.util.List<java.lang.String> includes)
@Nullable @Optional @Input public java.util.List<java.lang.String> getExcludes()
public void setExcludes(@Nullable
java.util.List<java.lang.String> excludes)
@Nullable @Optional @Input public java.util.List<java.lang.String> getExcludeClassLoaders()
public void setExcludeClassLoaders(@Nullable
java.util.List<java.lang.String> excludeClassLoaders)
@Input public boolean isIncludeNoLocationClasses()
false.
This property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.7.6)public void setIncludeNoLocationClasses(boolean includeNoLocationClasses)
@Nullable @Optional @Input public java.lang.String getSessionId()
public void setSessionId(@Nullable
java.lang.String sessionId)
@Input public boolean isDumpOnExit()
true.public void setDumpOnExit(boolean dumpOnExit)
@Input public JacocoTaskExtension.Output getOutput()
JacocoTaskExtension.Output.FILE.public void setOutput(JacocoTaskExtension.Output output)
@Nullable @Optional @Input public java.lang.String getAddress()
JacocoTaskExtension.Output.TCP_SERVER or JacocoTaskExtension.Output.TCP_CLIENT. Defaults to localhost.public void setAddress(@Nullable
java.lang.String address)
@Input public int getPort()
JacocoTaskExtension.Output.TCP_SERVER or JacocoTaskExtension.Output.TCP_CLIENT. Defaults to 6300.public void setPort(int port)
@Nullable @Optional @LocalState public java.io.File getClassDumpDir()
public void setClassDumpDir(@Nullable
java.io.File classDumpDir)
@Input public boolean isJmx()
org.jacoco:type=Runtime. Defaults to false.
The configuration of the jmx property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.6.2)public void setJmx(boolean jmx)
@Classpath public org.gradle.api.file.FileCollection getAgentClasspath()
@Deprecated @Internal public java.lang.String getAsJvmArg()
asJvmArgs() instead.@Incubating public java.util.List<java.lang.String> asJvmArgs()