@Incubating public class JacocoTaskExtension extends 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.internal.jacoco.JacocoAgentJar agent,
JavaForkOptions task)
Creates a Jacoco task extension.
|
Modifier and Type | Method and Description |
---|---|
String |
getAddress()
IP address or hostname to use with
JacocoTaskExtension.Output.TCP_SERVER or JacocoTaskExtension.Output.TCP_CLIENT . |
org.gradle.internal.jacoco.JacocoAgentJar |
getAgent()
Deprecated.
Agent should be considered final.
|
String |
getAsJvmArg()
Gets all properties in the format expected of the agent JVM argument.
|
File |
getClassDumpFile()
Path to dump all class files the agent sees are dumped to.
|
File |
getDestinationFile()
The path for the execution data to be written to.
|
List<String> |
getExcludeClassLoaders()
List of classloader names that should be excluded from analysis.
|
List<String> |
getExcludes()
List of class names that should be excluded from analysis.
|
List<String> |
getIncludes()
List of class names that should be included in analysis.
|
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 . |
String |
getSessionId()
An identifier for the session written to the execution data.
|
boolean |
isAppend()
Whether or not data should be appended if the
destinationFile already exists. |
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(String address) |
void |
setAgent(org.gradle.internal.jacoco.JacocoAgentJar agent)
Deprecated.
Agent should be considered final.
|
void |
setAppend(boolean append) |
void |
setClassDumpFile(File classDumpFile) |
void |
setDestinationFile(File destinationFile) |
void |
setDumpOnExit(boolean dumpOnExit) |
void |
setEnabled(boolean enabled) |
void |
setExcludeClassLoaders(List<String> excludeClassLoaders) |
void |
setExcludes(List<String> excludes) |
void |
setIncludeNoLocationClasses(boolean includeNoLocationClasses) |
void |
setIncludes(List<String> includes) |
void |
setJmx(boolean jmx) |
void |
setOutput(JacocoTaskExtension.Output output) |
void |
setPort(int port) |
void |
setSessionId(String sessionId) |
public JacocoTaskExtension(org.gradle.internal.jacoco.JacocoAgentJar agent, JavaForkOptions task)
agent
- the agent JAR to use for analysistask
- the task we extendpublic boolean isEnabled()
true
.public void setEnabled(boolean enabled)
public File getDestinationFile()
public void setDestinationFile(File destinationFile)
public boolean isAppend()
destinationFile
already exists. Defaults to true
.public void setAppend(boolean append)
public List<String> getIncludes()
public List<String> getExcludes()
public List<String> getExcludeClassLoaders()
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)
public String getSessionId()
public void setSessionId(String sessionId)
public boolean isDumpOnExit()
true
.public void setDumpOnExit(boolean dumpOnExit)
public JacocoTaskExtension.Output getOutput()
JacocoTaskExtension.Output.FILE
.public void setOutput(JacocoTaskExtension.Output output)
public String getAddress()
JacocoTaskExtension.Output.TCP_SERVER
or JacocoTaskExtension.Output.TCP_CLIENT
. Defaults to localhost.public void setAddress(String address)
public int getPort()
JacocoTaskExtension.Output.TCP_SERVER
or JacocoTaskExtension.Output.TCP_CLIENT
. Defaults to 6300.public void setPort(int port)
public File getClassDumpFile()
public void setClassDumpFile(File classDumpFile)
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)
@Deprecated public org.gradle.internal.jacoco.JacocoAgentJar getAgent()
@Deprecated public void setAgent(org.gradle.internal.jacoco.JacocoAgentJar agent)
public String getAsJvmArg()