Methods Summary |
---|
protected void | addFilesAndExecute(NetCommand command, boolean ignoreTimestamps)finish off the command by adding all dependent files, execute
long outputTimestamp = getOutputFileTimestamp();
Hashtable filesToBuild = new Hashtable();
int filesOutOfDate = buildFileList(command, filesToBuild, outputTimestamp);
//now run the command of exe + settings + files
if (filesOutOfDate > 0) {
//add the files to the command
addFilesToCommand(filesToBuild, command);
command.runCommand();
} else {
log("output file is up to date", Project.MSG_VERBOSE);
}
|
protected void | addFilesToCommand(java.util.Hashtable filesToBuild, NetCommand command)add the list of files to a command
int count = filesToBuild.size();
log("compiling " + count + " file" + ((count == 1) ? "" : "s"),
Project.MSG_VERBOSE);
Enumeration files = filesToBuild.elements();
while (files.hasMoreElements()) {
File file = (File) files.nextElement();
command.addArgument(file.toString());
}
|
public void | addSrc(org.apache.tools.ant.types.FileSet src)add a new source directory to the compile
filesets.add(src);
|
protected int | buildFileList(NetCommand command, java.util.Hashtable filesToBuild, long outputTimestamp)create the list of files
int filesOutOfDate = 0;
boolean scanImplicitFileset
= getSrcDir() != null || filesets.size() == 0;
if (scanImplicitFileset) {
//scan for an implicit fileset if there was a srcdir set
//or there was no srcDir set but there was no contained classes
if (getSrcDir() == null) {
//if there is no src dir here, set it
setSrcDir(getProject().resolveFile("."));
}
log("working from source directory " + getSrcDir(),
Project.MSG_VERBOSE);
//get dependencies list.
DirectoryScanner scanner = getDirectoryScanner(getSrcDir());
filesOutOfDate = command.scanOneFileset(scanner,
filesToBuild, outputTimestamp);
}
//get any included source directories
for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
filesOutOfDate += command.scanOneFileset(
fs.getDirectoryScanner(getProject()),
filesToBuild,
outputTimestamp);
}
return filesOutOfDate;
|
public java.io.File | getDestFile()get the destination file
return outputFile;
|
protected long | getOutputFileTimestamp()determine the timestamp of the output file
long outputTimestamp;
if (getDestFile() != null && getDestFile().exists()) {
outputTimestamp = getDestFile().lastModified();
} else {
outputTimestamp = 0;
}
return outputTimestamp;
|
public java.io.File | getSrcDir()Overridden because we need to be able to set the srcDir.
// CheckStyle:ConstantNameCheck ON
// CheckStyle:VisibilityModifier ON
return this.srcDir;
|
public void | setDestFile(java.io.File file)Set the name of exe/library to create.
outputFile = file;
|
public void | setSrcDir(java.io.File srcDirName)Set the source directory of the files to be compiled.
this.srcDir = srcDirName;
|