Package org.jacoco.ant
Class CoverageTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.jacoco.ant.AbstractCoverageTask
-
- org.jacoco.ant.CoverageTask
-
- All Implemented Interfaces:
java.lang.Cloneable
,org.apache.tools.ant.TaskContainer
public class CoverageTask extends AbstractCoverageTask implements org.apache.tools.ant.TaskContainer
Container task to run Java/JUnit tasks with the JaCoCo agent jar. Coverage will only be applied if all of the following are true:- Exactly one sub task may be present
- Task must be either Java or JUnit
- Task must be using a forked VM (so vm args can be passed)
-
-
Constructor Summary
Constructors Constructor Description CoverageTask()
Creates a new default coverage task
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTask(org.apache.tools.ant.Task task)
Add child task to this container and reconfigure it to run with coverage enabledvoid
execute()
Executes subtask and performs any required cleanup-
Methods inherited from class org.jacoco.ant.AbstractCoverageTask
getLaunchingArgument, isEnabled, setAddress, setAppend, setClassdumpdir, setDestfile, setDumpOnExit, setEnabled, setExclClassLoader, setExcludes, setInclBootstrapClasses, setInclNoLocationClasses, setIncludes, setJmx, setOutput, setPort, setSessionId
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
addTask
public void addTask(org.apache.tools.ant.Task task)
Add child task to this container and reconfigure it to run with coverage enabled- Specified by:
addTask
in interfaceorg.apache.tools.ant.TaskContainer
-
execute
public void execute() throws org.apache.tools.ant.BuildException
Executes subtask and performs any required cleanup- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
-