Modifier and Type | Class and Description |
---|---|
private static class | Depend.ClassFileInfo
A class (struct) user to manage information about a class |
Modifier and Type | Field and Description |
---|---|
private Map | affectedClassMap
A map which gives for every class a list of the class which it affects. |
private File | cache
The directory which contains the dependency cache. |
private static final String | CACHE_FILE_NAME
constants used with the cache file |
private Map | classFileInfoMap
A map which gives information about a class |
private static final String | CLASSNAME_PREPEND
String Used to separate classnames in the dependency file |
private Map | classpathDependencies
A map which gives the list of jars and classes from the classpath that a class depends upon |
private boolean | closure
indicates that the dependency relationships should be extended beyond direct dependencies to include all classes. |
private Path | dependClasspath
The classpath to look for additional dependencies |
private Path | destPath
The path where compiled class files exist. |
private boolean | dump
Flag which controls whether the reversed dependencies should be dumped to the log |
private static final int | |
private Map | outOfDateClasses
The list of classes which are out of date. |
private Path | srcPath
The path where source files exist |
private boolean | warnOnRmiStubs
flag to enable warning if we encounter RMI stubs |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
private void | addClassFiles(List<Depend.
a list of ClassFileInfo objects for all the
files in the directory tree classFileList,the directory tree to be searched, recursively, for class
files dir, File the root of the source tree. This is used to determine
the absolute class name from the relative position in the
source tree root)Add the list of class files from the given directory to the class file vector, including any subdirectories. |
public Path | Returns: A path object to be configured by AntAdds a classpath to be used for this dependency check. |
private int | Returns: the number of class files removedthe name of the class whose dependent classes will be
deleted className)Delete all the class files of classes which depend on the given class |
private int | Returns: the number of files deleted.Delete all the class files which are out of date, by way of their dependency on a class which is out of date |
private void | |
private void | |
private Stream | |
private void | |
public void | |
private File | findSourceFile(String
the classname in slash format. classname, File if not null, a file already known to exist
(saves call to .exists()) sourceFileKnownToExist)Find the source file for a given class |
private Path | |
private List | Returns: a vector containing the classes to analyse.Get the list of class files we are going to analyse. |
public Path | Returns: the current dependency classpathGets the classpath to be used for this dependency check. |
private boolean | |
private boolean | |
private Map | Returns: a collection of class dependenciesRead the dependencies from cache file |
protected void | |
public void | |
public void | setClasspath(Path
the classpath to be used when checking for
dependencies on elements in the classpath classpath)Set the classpath to be used for this dependency check. |
public void | setClasspathRef(Reference
a reference to a path object to be used as the depend
classpath r)Adds a reference to a classpath defined elsewhere. |
public void | setClosure(boolean
indicate if dependency closure is required. closure)If true, transitive dependencies are followed until the closure of the dependency set if reached. |
public void | setDestDir(Path
the destination areas where build files are written destPath)Set the destination directory where the compiled Java files exist. |
public void | setDump(boolean
set to true to dump dependency information to the log dump)If true, the dependency information will be written to the debug level log. |
public void | |
public void | setWarnOnRmiStubs(boolean
if true set dependency issues to appear at warning level. warnOnRmiStubs)Flag to set to true if you want dependency issues with RMI stubs to appear at warning level. |
private void | warnOutOfDateButNotDeleted(Depend.
info about the affected class affectedClassInfo,the name of the affected .class file affectedClass, String the file that is triggering the out of dateness className)warn when a class is out of date, but not deleted as its source is unknown. |
private void | writeCachedDependencies(Map<String, List<String>>
the map of dependencies to be written out. dependencyMap)Write the dependencies to cache file |
affectedClassMap | back to summary |
---|---|
private Map<String, Map<String, Depend. A map which gives for every class a list of the class which it affects. |
cache | back to summary |
---|---|
private File cache The directory which contains the dependency cache. |
CACHE_FILE_NAME | back to summary |
---|---|
private static final String CACHE_FILE_NAME constants used with the cache file |
classFileInfoMap | back to summary |
---|---|
private Map<String, Depend. A map which gives information about a class |
CLASSNAME_PREPEND | back to summary |
---|---|
private static final String CLASSNAME_PREPEND String Used to separate classnames in the dependency file |
classpathDependencies | back to summary |
---|---|
private Map<String, Set<File>> classpathDependencies A map which gives the list of jars and classes from the classpath that a class depends upon |
closure | back to summary |
---|---|
private boolean closure indicates that the dependency relationships should be extended beyond direct dependencies to include all classes. So if A directly affects B and B directly affects C, then A indirectly affects C. |
dependClasspath | back to summary |
---|---|
private Path dependClasspath The classpath to look for additional dependencies |
destPath | back to summary |
---|---|
private Path destPath The path where compiled class files exist. |
dump | back to summary |
---|---|
private boolean dump Flag which controls whether the reversed dependencies should be dumped to the log |
ONE_SECOND | back to summary |
---|---|
private static final int ONE_SECOND |
outOfDateClasses | back to summary |
---|---|
private Map<String, String> outOfDateClasses The list of classes which are out of date. |
srcPath | back to summary |
---|---|
private Path srcPath The path where source files exist |
warnOnRmiStubs | back to summary |
---|---|
private boolean warnOnRmiStubs flag to enable warning if we encounter RMI stubs |
Depend | back to summary |
---|---|
public Depend() |
addClassFiles | back to summary |
---|---|
private void addClassFiles(List<Depend. Add the list of class files from the given directory to the class file vector, including any subdirectories.
|
createClasspath | back to summary |
---|---|
public Path createClasspath() Adds a classpath to be used for this dependency check.
|
deleteAffectedFiles | back to summary |
---|---|
private int deleteAffectedFiles(String className) Delete all the class files of classes which depend on the given class
|
deleteAllAffectedFiles | back to summary |
---|---|
private int deleteAllAffectedFiles() Delete all the class files which are out of date, by way of their dependency on a class which is out of date
|
determineDependencies | back to summary |
---|---|
private void determineDependencies() throws IOException Determine the dependencies between classes. Class dependencies are determined by examining the class references in a class file to other classes. This method sets up the following fields
|
determineOutOfDateClasses | back to summary |
---|---|
private void determineOutOfDateClasses() |
directories | back to summary |
---|---|
private Stream |
dumpDependencies | back to summary |
---|---|
private void dumpDependencies() Dump the dependency information loaded from the classes to the Ant log |
execute | back to summary |
---|---|
public void execute() throws BuildException Overrides org. Does the work.
|
findSourceFile | back to summary |
---|---|
private File findSourceFile(String classname, File sourceFileKnownToExist) Find the source file for a given class |
getCheckClassPath | back to summary |
---|---|
private Path getCheckClassPath() Get the classpath for dependency checking. This method removes the dest dirs if it is given from the dependency classpath |
getClassFiles | back to summary |
---|---|
private List Get the list of class files we are going to analyse.
|
getClasspath | back to summary |
---|---|
public Path getClasspath() Gets the classpath to be used for this dependency check.
|
isRmiStub | back to summary |
---|---|
private boolean isRmiStub(String affectedClass, String className) test for being an RMI stub |
isStub | back to summary |
---|---|
private boolean isStub(String affectedClass, String baseClass, String suffix) |
readCachedDependencies | back to summary |
---|---|
private Map Read the dependencies from cache file
|
scanDir | back to summary |
---|---|
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 |
setCache | back to summary |
---|---|
public void setCache(File cache) Sets the dependency cache file.
|
setClasspath | back to summary |
---|---|
public void setClasspath(Path classpath) Set the classpath to be used for this dependency check.
|
setClasspathRef | back to summary |
---|---|
public void setClasspathRef(Reference r) Adds a reference to a classpath defined elsewhere.
|
setClosure | back to summary |
---|---|
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.
|
setDestDir | back to summary |
---|---|
public void setDestDir(Path destPath) Set the destination directory where the compiled Java files exist.
|
setDump | back to summary |
---|---|
public void setDump(boolean dump) If true, the dependency information will be written to the debug level log.
|
setSrcdir | back to summary |
---|---|
public void setSrcdir(Path srcPath) Set the directories path to find the Java source files.
|
setWarnOnRmiStubs | back to summary |
---|---|
public void setWarnOnRmiStubs(boolean warnOnRmiStubs) Flag to set to true if you want dependency issues with RMI stubs to appear at warning level.
|
warnOutOfDateButNotDeleted | back to summary |
---|---|
private void warnOutOfDateButNotDeleted(Depend. warn when a class is out of date, but not deleted as its source is unknown.
MSG_WARN is the normal level, but we downgrade to MSG_VERBOSE for RMI files
if
|
writeCachedDependencies | back to summary |
---|---|
private void writeCachedDependencies(Map<String, List<String>> dependencyMap) throws IOException Write the dependencies to cache file
|
Modifier and Type | Field and Description |
---|---|
private File | absoluteFile
The file where the class file is stored in the file system |
private String | className
The Java class name of this class |
private boolean | isUserWarned
if user has been warned about this file not having a source file |
private File | sourceFile
The source File containing this class |
Access | Constructor and Description |
---|---|
private |
absoluteFile | back to summary |
---|---|
private File absoluteFile The file where the class file is stored in the file system |
className | back to summary |
---|---|
private String className The Java class name of this class |
isUserWarned | back to summary |
---|---|
private boolean isUserWarned if user has been warned about this file not having a source file |
sourceFile | back to summary |
---|---|
private File sourceFile The source File containing this class |
ClassFileInfo | back to summary |
---|---|
private ClassFileInfo() |