Methods Summary |
---|
public void | addFileset(org.apache.tools.ant.types.FileSet set)Add a fileset whose files will be added to Perforce.
filesets.addElement(set);
|
private void | execP4Add(java.lang.StringBuffer list)
log("Execing add " + P4CmdOpts + " " + addCmd + list, Project.MSG_INFO);
execP4Command("-s add " + P4CmdOpts + " " + addCmd + list, new SimpleP4OutputHandler(this));
|
public void | execute()Run the task.
if (P4View != null) {
addCmd = P4View;
}
P4CmdOpts = (changelist > 0) ? ("-c " + changelist) : "";
StringBuffer filelist = new StringBuffer();
for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
String[] srcFiles = ds.getIncludedFiles();
if (srcFiles != null) {
for (int j = 0; j < srcFiles.length; j++) {
File f = new File(ds.getBasedir(), srcFiles[j]);
filelist.append(" ").append('"").append(f.getAbsolutePath()).append('"");
if (filelist.length() > cmdLength) {
execP4Add(filelist);
filelist = new StringBuffer();
}
}
if (filelist.length() > 0) {
execP4Add(filelist);
}
} else {
log("No files specified to add!", Project.MSG_WARN);
}
}
|
public void | setChangelist(int changelist)If specified the open files are associated with the
specified pending changelist number; otherwise the open files are
associated with the default changelist.
if (changelist <= 0) {
throw new BuildException("P4Add: Changelist# should be a positive number");
}
this.changelist = changelist;
|
public void | setCommandlength(int len)Set the maximum length
of the commandline when calling Perforce to add the files.
Defaults to 450, higher values mean faster execution,
but also possible failures.
if (len <= 0) {
throw new BuildException("P4Add: Commandlength should be a positive number");
}
this.cmdLength = len;
|