Methods Summary |
---|
private void | checkOptions(org.apache.tools.ant.types.Commandline cmd)Check the command line options.
if (getComment() != null) {
// -c
getCommentCommand(cmd);
} else {
if (getCommentFile() != null) {
// -cfile
getCommentFileCommand(cmd);
} else {
cmd.createArgument().setValue(FLAG_NOCOMMENT);
}
}
if (getNoCheckout()) {
// -nco
cmd.createArgument().setValue(FLAG_NOCHECKOUT);
}
// viewpath
cmd.createArgument().setValue(getViewPath());
|
public void | execute()Executes the task.
Builds a command line to execute cleartool and then calls Exec's run method
to execute the command line.
Commandline commandLine = new Commandline();
Project aProj = getProject();
int result = 0;
// Default the viewpath to basedir if it is not specified
if (getViewPath() == null) {
setViewPath(aProj.getBaseDir().getPath());
}
// build the command line from what we got. the format is
// cleartool mkelem [options...] [viewpath ...]
// as specified in the CLEARTOOL.EXE help
commandLine.setExecutable(getClearToolCommand());
commandLine.createArgument().setValue(COMMAND_MKDIR);
checkOptions(commandLine);
if (!getFailOnErr()) {
getProject().log("Ignoring any errors that occur for: "
+ getViewPathBasename(), Project.MSG_VERBOSE);
}
result = run(commandLine);
if (Execute.isFailure(result) && getFailOnErr()) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, getLocation());
}
|
public java.lang.String | getComment()Get comment string
return mComment;
|
private void | getCommentCommand(org.apache.tools.ant.types.Commandline cmd)Get the 'comment' command
if (getComment() != null) {
/* Had to make two separate commands here because if a space is
inserted between the flag and the value, it is treated as a
Windows filename with a space and it is enclosed in double
quotes ("). This breaks clearcase.
*/
cmd.createArgument().setValue(FLAG_COMMENT);
cmd.createArgument().setValue(getComment());
}
|
public java.lang.String | getCommentFile()Get comment file
return mCfile;
|
private void | getCommentFileCommand(org.apache.tools.ant.types.Commandline cmd)Get the 'commentfile' command
if (getCommentFile() != null) {
/* Had to make two separate commands here because if a space is
inserted between the flag and the value, it is treated as a
Windows filename with a space and it is enclosed in double
quotes ("). This breaks clearcase.
*/
cmd.createArgument().setValue(FLAG_COMMENTFILE);
cmd.createArgument().setValue(getCommentFile());
}
|
public boolean | getNoCheckout()Get no checkout flag status
return mNoco;
|
public void | setComment(java.lang.String comment)Sets the comment string.
mComment = comment;
|
public void | setCommentFile(java.lang.String cfile)Specifies a file containing a comment.
mCfile = cfile;
|
public void | setNoCheckout(boolean co)If true, do not checkout element after creation.
mNoco = co;
|