Methods Summary |
---|
private void | checkOptions(org.apache.tools.ant.types.Commandline cmd)Check the command line options.
// ClearCase items
getCommentCommand(cmd);
if (getObjSelect() == null && getPname() == null) {
throw new BuildException("Should select either an element "
+ "(pname) or an object (objselect)");
}
getPnameCommand(cmd);
// object selector
if (getObjSelect() != null) {
cmd.createArgument().setValue(getObjSelect());
}
|
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 lock [options...]
// as specified in the CLEARTOOL.EXE help
commandLine.setExecutable(getClearToolCommand());
commandLine.createArgument().setValue(COMMAND_UNLOCK);
// Check the command line options
checkOptions(commandLine);
// For debugging
// System.out.println(commandLine.toString());
if (!getFailOnErr()) {
getProject().log("Ignoring any errors that occur for: "
+ getOpType(), 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 method
return mComment;
|
private void | getCommentCommand(org.apache.tools.ant.types.Commandline cmd)Get the 'comment' command
if (getComment() == null) {
return;
} else {
/* 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 | getObjselect()Get list of objects to be locked
return getObjSelect();
|
private java.lang.String | getOpType()Return which object/pname is being operated on
if (getPname() != null) {
return getPname();
} else {
return getObjSelect();
}
|
public java.lang.String | getPname()Get the pathname to be locked
return mPname;
|
private void | getPnameCommand(org.apache.tools.ant.types.Commandline cmd)Get the 'pname' command
if (getPname() == null) {
return;
} else {
/* 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_PNAME);
cmd.createArgument().setValue(getPname());
}
|
public void | setComment(java.lang.String comment)Sets how comments should be written
for the event record(s)
mComment = comment;
|
public void | setObjSel(java.lang.String objsel)Sets the object(s) to be locked
setObjSelect(objsel);
|
public void | setObjselect(java.lang.String objselect)Sets the object(s) to be locked
setObjSelect(objselect);
|
public void | setPname(java.lang.String pname)Sets the pathname to be locked
mPname = pname;
|