next up previous contents index
Next: EJB Tasks Up: Depend Previous: Performance   Contents   Index

Limitations

There are some source dependencies which depend will not detect.

The most obvious example of these limitations is that the task can't tell which classes to recompile when a constant primitive data type exported by other classes is changed. For example, a change in the definition of something like
public final class Constants {
  public final static boolean DEBUG=false;
}
will not be picked up by other classes.

Parameters

Attribute Values Required
srcDir This is the directory where the source exists. depend will examine this to determine which classes are out of date. If you use multiple source directories you can pass this attribute a path of source directories. Yes
destDir This is the root directory of the class files which will be analysed. If this is not present, the srcdir is used. No
cache This is a directory in which depend can store and retrieve dependency information. If this is not present, depend will not use a cache No
closure This attribute controls whether depend only removes classes which directly depend on out of date classes. If this is set to true, depend will traverse the class dependency graph deleting all affected classes. Defaults to false No
dump If true the dependency information will be written to the debug level log No
classpath The classpath containg jars and classes for which <depend> should also check dependencies No

Parameters specified as nested elements

The depend task's classpath attribute is a PATH-like structure and can also be set via a nested <classpath> element.

Additionally, this task forms an implicit FileSet and supports all attributes of <fileset> (dir becomes srcdir), as well as the nested <include>, <exclude>, and <patternset> elements.

Examples

<depend srcdir="${java.dir}"
        destdir="${build.classes}"
        cache="depcache"
        closure="yes"/>
removes any classes in the ${build.classes} directory that depend on out-of-date classes. Classes are considered out-of-date with respect to the source in the ${java.dir} directory, using the same mechanism as the <javac> task. In this example, the <depend> task caches its dependency information in the depcache directory.
<depend srcdir="${java.dir}" destdir="${build.classes}"
        cache="depcache" closure="yes">
  <include name="**/*.java"/>
  <excludesfile name="${java.dir}/build_excludes"/>
</depend>
does the same as the previous example, but explicitly includes all .java files, except those that match the list given in ${java.dir}/build_excludes.


next up previous contents index
Next: EJB Tasks Up: Depend Previous: Performance   Contents   Index
Andrew Marlow 2003-07-08