org.apache.tools.ant.taskdefs

Class DependSet

public class DependSet extends MatchingTask

Examines and removes out of date target files. If any of the target files are out of date with respect to any of the source files, all target files are removed. This is useful where dependencies cannot be computed (for example, dynamically interpreted parameters or files that need to stay in synch but are not directly linked) or where the ant task in question could compute them but does not (for example, the linked DTD for an XML file using the XSLT task). nested arguments: At least one of both source and target entities is required.

This task will examine each of the sources against each of the target files. If any target files are out of date with respect to any of the sources, all targets are removed. If any sources or targets do not exist, all targets are removed. Hint: If missing files should be ignored, specify them as include patterns in filesets, rather than using filelists.

This task attempts to optimize speed of dependency checking by comparing only the dates of the oldest target file and the newest source.

Example uses:

Since: Ant 1.4

UNKNOWN: category="filesystem"

Method Summary
voidaddSrcfilelist(FileList fl)
Add a list of source files.
voidaddSrcfileset(FileSet fs)
Add a set of source files.
voidaddTargetfilelist(FileList fl)
Add a list of target files.
voidaddTargetfileset(FileSet fs)
Add a set of target files.
UnioncreateSources()
Create a nested sources element.
PathcreateTargets()
Create a nested targets element.
voidexecute()
Execute the task.

Method Detail

addSrcfilelist

public void addSrcfilelist(FileList fl)
Add a list of source files.

Parameters: fl the FileList to add.

addSrcfileset

public void addSrcfileset(FileSet fs)
Add a set of source files.

Parameters: fs the FileSet to add.

addTargetfilelist

public void addTargetfilelist(FileList fl)
Add a list of target files.

Parameters: fl the FileList to add.

addTargetfileset

public void addTargetfileset(FileSet fs)
Add a set of target files.

Parameters: fs the FileSet to add.

createSources

public Union createSources()
Create a nested sources element.

Returns: a Union instance.

createTargets

public Path createTargets()
Create a nested targets element.

Returns: a Union instance.

execute

public void execute()
Execute the task.

Throws: BuildException if errors occur.