Fields Summary |
---|
private boolean | mGraphical |
private boolean | mOverwrite |
private boolean | mRename |
private boolean | mCtime |
private boolean | mPtime |
private String | mLog |
public static final String | FLAG_GRAPHICAL-graphical flag -- display graphical dialog during update operation |
public static final String | FLAG_LOG-log flag -- file to log status to |
public static final String | FLAG_OVERWRITE-overwrite flag -- overwrite hijacked files |
public static final String | FLAG_NOVERWRITE-noverwrite flag -- do not overwrite hijacked files |
public static final String | FLAG_RENAME-rename flag -- rename hijacked files with .keep extension |
public static final String | FLAG_CURRENTTIME-ctime flag -- modified time is written as the current time |
public static final String | FLAG_PRESERVETIME-ptime flag -- modified time is written as the VOB time |
Methods Summary |
---|
private void | checkOptions(org.apache.tools.ant.types.Commandline cmd)Check the command line options.
// ClearCase items
if (getGraphical()) {
// -graphical
cmd.createArgument().setValue(FLAG_GRAPHICAL);
} else {
if (getOverwrite()) {
// -overwrite
cmd.createArgument().setValue(FLAG_OVERWRITE);
} else {
if (getRename()) {
// -rename
cmd.createArgument().setValue(FLAG_RENAME);
} else {
// -noverwrite
cmd.createArgument().setValue(FLAG_NOVERWRITE);
}
}
if (getCurrentTime()) {
// -ctime
cmd.createArgument().setValue(FLAG_CURRENTTIME);
} else {
if (getPreserveTime()) {
// -ptime
cmd.createArgument().setValue(FLAG_PRESERVETIME);
}
}
// -log logname
getLogCommand(cmd);
}
// 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 update [options...] [viewpath ...]
// as specified in the CLEARTOOL.EXE help
commandLine.setExecutable(getClearToolCommand());
commandLine.createArgument().setValue(COMMAND_UPDATE);
// Check the command line options
checkOptions(commandLine);
// For debugging
getProject().log(commandLine.toString(), Project.MSG_DEBUG);
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 boolean | getCurrentTime()Get current time status
return mCtime;
|
public boolean | getGraphical()Get graphical flag status
return mGraphical;
|
public java.lang.String | getLog()Get log file
return mLog;
|
private void | getLogCommand(org.apache.tools.ant.types.Commandline cmd)Get the 'log' command
if (getLog() == 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_LOG);
cmd.createArgument().setValue(getLog());
}
|
public boolean | getOverwrite()Get overwrite hijacked files status
return mOverwrite;
|
public boolean | getPreserveTime()Get preserve time status
return mPtime;
|
public boolean | getRename()Get rename hijacked files status
return mRename;
|
public void | setCurrentTime(boolean ct)If true, modification time should be written as the current time.
Either currenttime or preservetime can be specified.
mCtime = ct;
|
public void | setGraphical(boolean graphical)If true, displays a graphical dialog during the update.
mGraphical = graphical;
|
public void | setLog(java.lang.String log)Sets the log file where cleartool records
the status of the command.
mLog = log;
|
public void | setOverwrite(boolean ow)If true, overwrite hijacked files.
mOverwrite = ow;
|
public void | setPreserveTime(boolean pt)If true, modification time should be preserved from the VOB time.
Either currenttime or preservetime can be specified.
mPtime = pt;
|
public void | setRename(boolean ren)If true, hijacked files are renamed with a .keep extension.
mRename = ren;
|