Package net.sf.antcontrib.cpptasks
Class DependencyTable
- java.lang.Object
-
- net.sf.antcontrib.cpptasks.DependencyTable
-
public final class DependencyTable extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DependencyTable.DependencyTableHandler
This class handles populates the TargetHistory hashtable in response to SAX parse eventsclass
DependencyTable.DependencyVisitor
class
DependencyTable.TimestampChecker
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
baseDir
private java.lang.String
baseDirPath
private java.util.Hashtable
dependencies
a hashtable of DependencyInfo[] keyed by output file nameprivate java.io.File
dependenciesFile
The file the cache was loaded from.private boolean
dirty
Flag indicating whether the cache should be written back to file.
-
Constructor Summary
Constructors Constructor Description DependencyTable(java.io.File baseDir)
Creates a target history table from dependencies.xml in the prject directory, if it exists.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(CCTask task)
java.util.Enumeration
elements()
Returns an enumerator of DependencyInfo'sDependencyInfo
getDependencyInfo(java.lang.String sourceRelativeName, java.lang.String includePathIdentifier)
This method returns a DependencyInfo for the specific source file and include path identifierprivate java.util.Vector
getIncludePaths()
void
load()
boolean
needsRebuild(CCTask task, TargetInfo target, int dependencyDepth)
Determines if the specified target needs to be rebuilt.DependencyInfo
parseIncludes(CCTask task, CompilerConfiguration compiler, java.io.File source)
private void
putDependencyInfo(java.lang.String key, DependencyInfo dependInfo)
void
walkDependencies(CCTask task, DependencyInfo dependInfo, CompilerConfiguration compiler, DependencyInfo[] stack, DependencyTable.DependencyVisitor visitor)
private void
writeDependencyInfo(java.io.BufferedWriter writer, java.lang.StringBuffer buf, DependencyInfo dependInfo)
private void
writeIncludePathDependencies(java.lang.String includePathIdentifier, java.io.BufferedWriter writer, java.lang.StringBuffer buf)
-
-
-
Field Detail
-
baseDir
private java.io.File baseDir
-
baseDirPath
private java.lang.String baseDirPath
-
dependencies
private final java.util.Hashtable dependencies
a hashtable of DependencyInfo[] keyed by output file name
-
dependenciesFile
private java.io.File dependenciesFile
The file the cache was loaded from.
-
dirty
private boolean dirty
Flag indicating whether the cache should be written back to file.
-
-
Method Detail
-
commit
public void commit(CCTask task)
-
elements
public java.util.Enumeration elements()
Returns an enumerator of DependencyInfo's
-
getDependencyInfo
public DependencyInfo getDependencyInfo(java.lang.String sourceRelativeName, java.lang.String includePathIdentifier)
This method returns a DependencyInfo for the specific source file and include path identifier
-
getIncludePaths
private java.util.Vector getIncludePaths()
-
load
public void load() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
-
needsRebuild
public boolean needsRebuild(CCTask task, TargetInfo target, int dependencyDepth)
Determines if the specified target needs to be rebuilt. This task may result in substantial IO as files are parsed to determine their dependencies
-
parseIncludes
public DependencyInfo parseIncludes(CCTask task, CompilerConfiguration compiler, java.io.File source)
-
putDependencyInfo
private void putDependencyInfo(java.lang.String key, DependencyInfo dependInfo)
-
walkDependencies
public void walkDependencies(CCTask task, DependencyInfo dependInfo, CompilerConfiguration compiler, DependencyInfo[] stack, DependencyTable.DependencyVisitor visitor) throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
writeDependencyInfo
private void writeDependencyInfo(java.io.BufferedWriter writer, java.lang.StringBuffer buf, DependencyInfo dependInfo) throws java.io.IOException
- Throws:
java.io.IOException
-
writeIncludePathDependencies
private void writeIncludePathDependencies(java.lang.String includePathIdentifier, java.io.BufferedWriter writer, java.lang.StringBuffer buf) throws java.io.IOException
- Throws:
java.io.IOException
-
-