Fields Summary |
---|
private String | mTypeName |
private String | mVOB |
private String | mComment |
private String | mCfile |
private boolean | mReplace |
private boolean | mGlobal |
private boolean | mOrdinary |
private boolean | mPbranch |
private boolean | mShared |
public static final String | FLAG_REPLACE-replace flag -- replace existing label definition of the same type |
public static final String | FLAG_GLOBAL-global flag -- creates a label type that is global to the VOB or to VOBs that use this VOB |
public static final String | FLAG_ORDINARY-ordinary flag -- creates a label type that can be used only in the current VOB |
public static final String | FLAG_PBRANCH-pbranch flag -- allows label type to be used once per branch |
public static final String | FLAG_SHARED-shared flag -- sets the way mastership is checked by ClearCase |
public static final String | FLAG_COMMENT-c flag -- comment to attach to the file |
public static final String | FLAG_COMMENTFILE-cfile flag -- file containing a comment to attach to the file |
public static final String | FLAG_NOCOMMENT-nc flag -- no comment is specified |
Methods Summary |
---|
private void | checkOptions(org.apache.tools.ant.types.Commandline cmd)Check the command line options.
if (getReplace()) {
// -replace
cmd.createArgument().setValue(FLAG_REPLACE);
}
if (getOrdinary()) {
// -ordinary
cmd.createArgument().setValue(FLAG_ORDINARY);
} else {
if (getGlobal()) {
// -global
cmd.createArgument().setValue(FLAG_GLOBAL);
}
}
if (getPbranch()) {
// -pbranch
cmd.createArgument().setValue(FLAG_PBRANCH);
}
if (getShared()) {
// -shared
cmd.createArgument().setValue(FLAG_SHARED);
}
if (getComment() != null) {
// -c
getCommentCommand(cmd);
} else {
if (getCommentFile() != null) {
// -cfile
getCommentFileCommand(cmd);
} else {
cmd.createArgument().setValue(FLAG_NOCOMMENT);
}
}
// type-name@vob
cmd.createArgument().setValue(getTypeSpecifier());
|
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();
int result = 0;
// Check for required attributes
if (getTypeName() == null) {
throw new BuildException("Required attribute TypeName not specified");
}
// build the command line from what we got. the format is
// cleartool mklbtype [options...] type-selector...
// as specified in the CLEARTOOL help
commandLine.setExecutable(getClearToolCommand());
commandLine.createArgument().setValue(COMMAND_MKLBTYPE);
checkOptions(commandLine);
if (!getFailOnErr()) {
getProject().log("Ignoring any errors that occur for: "
+ getTypeSpecifier(), 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 | getGlobal()Get global flag status
return mGlobal;
|
public boolean | getOrdinary()Get ordinary flag status
return mOrdinary;
|
public boolean | getPbranch()Get pbranch flag status
return mPbranch;
|
public boolean | getReplace()Get replace flag status
return mReplace;
|
public boolean | getShared()Get shared flag status
return mShared;
|
public java.lang.String | getTypeName()Get type-name string
return mTypeName;
|
private java.lang.String | getTypeSpecifier()Get the type-name specifier
String typenm = null;
typenm = getTypeName();
if (getVOB() != null) {
typenm += "@" + getVOB();
}
return typenm;
|
public java.lang.String | getVOB()Get VOB name
return mVOB;
|
public void | setComment(java.lang.String comment)Set comment string
mComment = comment;
|
public void | setCommentFile(java.lang.String cfile)Set comment file
mCfile = cfile;
|
public void | setGlobal(boolean glob)Set the global flag
mGlobal = glob;
|
public void | setOrdinary(boolean ordinary)Set the ordinary flag
mOrdinary = ordinary;
|
public void | setPbranch(boolean pbranch)Set the pbranch flag
mPbranch = pbranch;
|
public void | setReplace(boolean repl)Set the replace flag
mReplace = repl;
|
public void | setShared(boolean shared)Set the shared flag
mShared = shared;
|
public void | setTypeName(java.lang.String tn)Set type-name string
mTypeName = tn;
|
public void | setVOB(java.lang.String vob)Set the VOB name
mVOB = vob;
|