org.apache.tools.ant.taskdefs.optional.depend

Class Depend

public class Depend extends MatchingTask

Generates a dependency file for a given set of classes.
Method Summary
PathcreateClasspath()
Adds a classpath to be used for this dependency check.
voidexecute()
Does the work.
PathgetClasspath()
Gets the classpath to be used for this dependency check.
protected voidscanDir(File srcDir, String[] files)
Scans the directory looking for source files that are newer than their class files.
voidsetCache(File cache)
Sets the dependency cache file.
voidsetClasspath(Path classpath)
Set the classpath to be used for this dependency check.
voidsetClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere.
voidsetClosure(boolean closure)
If true, transitive dependencies are followed until the closure of the dependency set if reached.
voidsetDestDir(Path destPath)
Set the destination directory where the compiled Java files exist.
voidsetDump(boolean dump)
If true, the dependency information will be written to the debug level log.
voidsetSrcdir(Path srcPath)
Set the directories path to find the Java source files.
voidsetWarnOnRmiStubs(boolean warnOnRmiStubs)
Flag to set to true if you want dependency issues with RMI stubs to appear at warning level.

Method Detail

createClasspath

public Path createClasspath()
Adds a classpath to be used for this dependency check.

Returns: A path object to be configured by Ant

execute

public void execute()
Does the work.

Throws: BuildException Thrown in case of an unrecoverable error.

getClasspath

public Path getClasspath()
Gets the classpath to be used for this dependency check.

Returns: the current dependency classpath

scanDir

protected void scanDir(File srcDir, String[] files)
Scans the directory looking for source files that are newer than their class files. The results are returned in the class variable compileList

Parameters: srcDir the source directory files the names of the files in the source dir which are to be checked.

setCache

public void setCache(File cache)
Sets the dependency cache file.

Parameters: cache the dependency cache file

setClasspath

public void setClasspath(Path classpath)
Set the classpath to be used for this dependency check.

Parameters: classpath the classpath to be used when checking for dependencies on elements in the classpath

setClasspathRef

public void setClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere.

Parameters: r a reference to a path object to be used as the depend classpath

setClosure

public void setClosure(boolean closure)
If true, transitive dependencies are followed until the closure of the dependency set if reached. When not set, the depend task will only follow direct dependencies between classes.

Parameters: closure indicate if dependency closure is required.

setDestDir

public void setDestDir(Path destPath)
Set the destination directory where the compiled Java files exist.

Parameters: destPath the destination areas where build files are written

setDump

public void setDump(boolean dump)
If true, the dependency information will be written to the debug level log.

Parameters: dump set to true to dump dependency information to the log

setSrcdir

public void setSrcdir(Path srcPath)
Set the directories path to find the Java source files.

Parameters: srcPath the source path

setWarnOnRmiStubs

public void setWarnOnRmiStubs(boolean warnOnRmiStubs)
Flag to set to true if you want dependency issues with RMI stubs to appear at warning level.

Parameters: warnOnRmiStubs if true set dependency issues to appear at warning level.

Since: Ant1.7