Methods Summary |
---|
public void | addFileset(org.apache.tools.ant.types.FileSet set)Adds a set of files to copy.
filesets.addElement(set);
|
private void | checkOptions(org.apache.tools.ant.types.Commandline cmd)Check the command line options.
if (getComment() != null) {
cmd.createArgument().setValue(FLAG_COMMENT);
cmd.createArgument().setValue(getComment());
}
if (getTask() != null) {
cmd.createArgument().setValue(FLAG_TASK);
cmd.createArgument().setValue(getTask());
}
if (getFile() != null) {
cmd.createArgument().setValue(file.getAbsolutePath());
}
|
private void | doit()check the file given by getFile().
Commandline commandLine = new Commandline();
// build the command line from what we got the format is
// ccm co /t .. files
// as specified in the CCM.EXE help
commandLine.setExecutable(getCcmCommand());
commandLine.createArgument().setValue(getCcmAction());
checkOptions(commandLine);
int result = run(commandLine);
if (Execute.isFailure(result)) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, getLocation());
}
|
public void | execute()Executes the task.
Builds a command line to execute ccm and then calls Exec's run method
to execute the command line.
if (file == null && filesets.size() == 0) {
throw new BuildException(
"Specify at least one source - a file or a fileset.");
}
if (file != null && file.exists() && file.isDirectory()) {
throw new BuildException("CCMCheck cannot be generated for directories");
}
if (file != null && filesets.size() > 0) {
throw new BuildException("Choose between file and fileset !");
}
if (getFile() != null) {
doit();
return;
}
int sizeofFileSet = filesets.size();
for (int i = 0; i < sizeofFileSet; i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
String[] srcFiles = ds.getIncludedFiles();
for (int j = 0; j < srcFiles.length; j++) {
File src = new File(fs.getDir(getProject()), srcFiles[j]);
setFile(src);
doit();
}
}
|
public java.lang.String | getComment()Get the value of comment.
return comment;
|
public java.io.File | getFile()Get the value of file.
return file;
|
public java.lang.String | getTask()Get the value of task.
return task;
|
public void | setComment(java.lang.String v)Specifies a comment.
this.comment = v;
|
public void | setFile(java.io.File v)Sets the path to the file that the command will operate on.
log("working file " + v, Project.MSG_VERBOSE);
this.file = v;
|
public void | setTask(java.lang.String v)Specifies the task number used to check
in the file (may use 'default').
this.task = v;
|