Package org.openclover.ant.tasks
Class CloverSetupTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.openclover.ant.tasks.AbstractCloverTask
org.openclover.ant.tasks.AbstractInstrTask
org.openclover.ant.tasks.CloverSetupTask
- All Implemented Interfaces:
Cloneable
Clover Task which sets up clover and encapsulates all the
complexity of the clover compiler adapter setup (namely the
properties required to be setup.
- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStandard Ant property for compiler selectionstatic final StringThe Clover compiler adapter classFields inherited from class org.openclover.ant.tasks.AbstractInstrTask
optimizationOnlyFields inherited from class org.openclover.ant.tasks.AbstractCloverTask
config, debugFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFiles(org.apache.tools.ant.types.PatternSet filesPattern) Set the pattern set for the files to be included or excluded from cloveringvoidSetup Clover to run.voidsetCloverCompiler(String cloverCompiler) Set the underlying compiler that clover will use to compile the code.voidsetEnabled(boolean enabled) Set the flag which controls whether clover is enabled or not.voidsetGroverJar(File groverJar) Sets a fixed name and location for the temporary grover.jar artifact which is being used for compilation of Groovy code.voidsetPreserve(boolean preserve) Flag to indicate whether the instrumented source should be saved.voidsetSkipGroverJar(boolean skip) If set to true, then skips generation of grover.jar artifact during setup.Methods inherited from class org.openclover.ant.tasks.AbstractInstrTask
addConfiguredDistributedCoverage, addConfiguredFileSet, addConfiguredProfiles, addConfiguredTestSources, addMethodContext, addStatementContext, getRuntimeInitString, setEncoding, setFlushInterval, setFlushPolicy, setFullyQualifyJavaLang, setInstrumentationLevel, setInstrumentLambda, setOptimizationOnly, setRecordTestResults, setRelative, setReportInitErrors, setSource, validateMethods inherited from class org.openclover.ant.tasks.AbstractCloverTask
execute, getInitString, init, resolveInitString, setDebug, setInitString, setTmpDirMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
BUILD_COMPILER
Standard Ant property for compiler selection- See Also:
-
CLOVER_ADAPTER
The Clover compiler adapter class- See Also:
-
-
Constructor Details
-
CloverSetupTask
public CloverSetupTask()
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) Set the flag which controls whether clover is enabled or not.- Parameters:
enabled- if true clover will instrument files as they are compiled.
-
setCloverCompiler
Set the underlying compiler that clover will use to compile the code.- Parameters:
cloverCompiler- the compiler spec - this is the same as the standard Antbuild.compilervalue.
-
setPreserve
public void setPreserve(boolean preserve) Flag to indicate whether the instrumented source should be saved.- Parameters:
preserve- if true the instrumented code is kept.
-
setGroverJar
Sets a fixed name and location for the temporary grover.jar artifact which is being used for compilation of Groovy code. By default grover*.jar has unique, generated file name and is located in ${java.io.tmpdir} directory. Note that file will be deleted on JVM termination unless "clover.no.postbuild.cleanup" property is defined.- Parameters:
groverJar- path where grover.jar will be written- Since:
- 3.1.8
-
setSkipGroverJar
public void setSkipGroverJar(boolean skip) If set to true, then skips generation of grover.jar artifact during setup. Can be set to true only if there is no Groovy code in the project.- Parameters:
skip- if true then grover.jar will not be created and Groovy code not instrumented- Since:
- 3.1.8
-
addFiles
public void addFiles(org.apache.tools.ant.types.PatternSet filesPattern) Set the pattern set for the files to be included or excluded from clovering- Parameters:
filesPattern- the patternset to use
-
cloverExecute
public void cloverExecute()Setup Clover to run. Note that this task just enables the clover compiler adapter - it does not do much more than setup some properties and structures.- Specified by:
cloverExecutein classAbstractCloverTask
-