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

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.optional.depend.Depend
All Implemented Interfaces:
SelectorContainer

public class Depend
extends MatchingTask

Generates a dependency file for a given set of classes.


Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Depend()
           
 
Method Summary
 Path createClasspath()
          Adds a classpath to be used for this dependency check.
 void execute()
          Does the work.
 Path getClasspath()
          Gets the classpath to be used for this dependency check.
protected  void scanDir(java.io.File srcDir, java.lang.String[] files)
          Scans the directory looking for source files that are newer than their class files.
 void setCache(java.io.File cache)
          Sets the dependency cache file.
 void setClasspath(Path classpath)
          Set the classpath to be used for this dependency check.
 void setClasspathRef(Reference r)
          Adds a reference to a classpath defined elsewhere.
 void setClosure(boolean closure)
          If true, transitive dependencies are followed until the closure of the dependency set if reached.
 void setDestDir(Path destPath)
          Set the destination directory where the compiled Java files exist.
 void setDump(boolean dump)
          If true, the dependency information will be written to the debug level log.
 void setSrcdir(Path srcPath)
          Set the directories path to find the Java source files.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Depend

public Depend()
Method Detail

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

getClasspath

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

Returns:
the current dependency classpath

createClasspath

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

Returns:
A path object to be configured by Ant

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

execute

public void execute()
             throws BuildException
Does the work.

Overrides:
execute in class Task
Throws:
BuildException - Thrown in case of an unrecoverable error.

scanDir

protected void scanDir(java.io.File srcDir,
                       java.lang.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.

setSrcdir

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

Parameters:
srcPath - the source path

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

setCache

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

Parameters:
cache - the dependency cache file

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.

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


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.