Package net.sf.antcontrib.logic
Class OutOfDate
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- net.sf.antcontrib.logic.OutOfDate
-
- All Implemented Interfaces:
java.lang.Cloneable,org.apache.tools.ant.taskdefs.condition.Condition
public class OutOfDate extends org.apache.tools.ant.Task implements org.apache.tools.ant.taskdefs.condition.ConditionTask to help in calling tasks if generated files are older than source files. Sets a given property or runs an internal task. Based on org.apache.org.apache.tools.ant.taskdefs.UpToDate- Author:
- peter reilly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOutOfDate.CollectionEnumEnumerated type for collection attributeclassOutOfDate.DeleteTargetsnested delete targetsstatic classOutOfDate.MyMapperWrapper for mapper - includes dir
-
Constructor Summary
Constructors Constructor Description OutOfDate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParallel(org.apache.tools.ant.taskdefs.Parallel doTask)Embedded do parallelvoidaddSequential(org.apache.tools.ant.taskdefs.Sequential doTask)Embedded do sequential.OutOfDate.DeleteTargetscreateDeleteTargets()optional nested delete elementorg.apache.tools.ant.types.MappercreateMapper()Defines the FileNameMapper to use (nested mapper element).org.apache.tools.ant.types.PathcreateSourcefiles()Add to the source filesorg.apache.tools.ant.types.PathcreateTargetfiles()Add to the target filesbooleaneval()Evaluate (all) target and source file(s) to see if the target(s) is/are outoutdate.voidexecute()Sets property to true and/or executes embedded do if any of the target file(s) do not have a more recent timestamp than (each of) the source file(s).java.util.Iteratoriterator()Call evalute and return an iterator over the resultvoidsetAllTargets(java.lang.String allTargets)A property to contain all the target filenamesvoidsetAllTargetsPath(java.lang.String allTargetsPath)A refernce to contain the path of all the targetsvoidsetCollection(OutOfDate.CollectionEnum collection)Set the collection attribute, controls what is returned by the iterator method.voidsetForce(boolean force)whether to allways be outofdatevoidsetOutputSources(java.lang.String outputSources)A property to contain the output source filesvoidsetOutputSourcesPath(java.lang.String outputSourcesPath)A reference to the path containing all the sources files.voidsetOutputTargets(java.lang.String outputTargets)A property to contain the output target filesvoidsetOutputTargetsPath(java.lang.String outputTargetsPath)A reference to contain the path of target files that are outofdatevoidsetProperty(java.lang.String property)The property to set if any of the target files are outofdate with regard to any of the source files.voidsetSeparator(java.lang.String separator)The separator to use to separate the filesvoidsetValue(java.lang.String value)The value to set the named property to the target files are outofdatevoidsetVerbose(boolean verbose)whether to have verbose output-
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
-
setCollection
public void setCollection(OutOfDate.CollectionEnum collection)
Set the collection attribute, controls what is returned by the iterator method.- "sources" the sources that are newer than the corresponding targets.
- "targets" the targets that are older or not present than the corresponding sources.
- "allsources" all the sources
- "alltargets" all the targets
- Parameters:
collection- "sources" the changes
-
createMapper
public org.apache.tools.ant.types.Mapper createMapper()
Defines the FileNameMapper to use (nested mapper element).- Returns:
- Mappper to be configured
-
setProperty
public void setProperty(java.lang.String property)
The property to set if any of the target files are outofdate with regard to any of the source files.- Parameters:
property- the name of the property to set if Target is outofdate.
-
setSeparator
public void setSeparator(java.lang.String separator)
The separator to use to separate the files- Parameters:
separator- separator used in outout properties
-
setValue
public void setValue(java.lang.String value)
The value to set the named property to the target files are outofdate- Parameters:
value- the value to set the property
-
setForce
public void setForce(boolean force)
whether to allways be outofdate- Parameters:
force- true means that outofdate is always set, default false
-
setVerbose
public void setVerbose(boolean verbose)
whether to have verbose output- Parameters:
verbose- true means that outofdate outputs debug info
-
createTargetfiles
public org.apache.tools.ant.types.Path createTargetfiles()
Add to the target files- Returns:
- a path to be configured
-
createSourcefiles
public org.apache.tools.ant.types.Path createSourcefiles()
Add to the source files- Returns:
- a path to be configured
-
setOutputSources
public void setOutputSources(java.lang.String outputSources)
A property to contain the output source files- Parameters:
outputSources- the name of the property
-
setOutputTargets
public void setOutputTargets(java.lang.String outputTargets)
A property to contain the output target files- Parameters:
outputTargets- the name of the property
-
setOutputTargetsPath
public void setOutputTargetsPath(java.lang.String outputTargetsPath)
A reference to contain the path of target files that are outofdate- Parameters:
outputTargetsPath- the name of the reference
-
setAllTargetsPath
public void setAllTargetsPath(java.lang.String allTargetsPath)
A refernce to contain the path of all the targets- Parameters:
allTargetsPath- the name of the reference
-
setAllTargets
public void setAllTargets(java.lang.String allTargets)
A property to contain all the target filenames- Parameters:
allTargets- the name of the property
-
setOutputSourcesPath
public void setOutputSourcesPath(java.lang.String outputSourcesPath)
A reference to the path containing all the sources files.- Parameters:
outputSourcesPath- the name of the reference
-
createDeleteTargets
public OutOfDate.DeleteTargets createDeleteTargets()
optional nested delete element- Returns:
- an element to be configured
-
addParallel
public void addParallel(org.apache.tools.ant.taskdefs.Parallel doTask)
Embedded do parallel- Parameters:
doTask- the parallel to embed
-
addSequential
public void addSequential(org.apache.tools.ant.taskdefs.Sequential doTask)
Embedded do sequential.- Parameters:
doTask- the sequential to embed
-
eval
public boolean eval()
Evaluate (all) target and source file(s) to see if the target(s) is/are outoutdate.- Specified by:
evalin interfaceorg.apache.tools.ant.taskdefs.condition.Condition- Returns:
- true if any of the targets are outofdate
-
iterator
public java.util.Iterator iterator()
Call evalute and return an iterator over the result- Returns:
- an iterator over the result
-
execute
public void execute()
Sets property to true and/or executes embedded do if any of the target file(s) do not have a more recent timestamp than (each of) the source file(s).- Overrides:
executein classorg.apache.tools.ant.Task
-
-