Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.clearcase

public abstract Class ClearCase

extends Task
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckin, org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout, org.apache.tools.ant.taskdefs.optional.clearcase.CCLock, org.apache.tools.ant.taskdefs.optional.clearcase.CCMkattr, org.apache.tools.ant.taskdefs.optional.clearcase.CCMkbl, org.apache.tools.ant.taskdefs.optional.clearcase.CCMkdir, org.apache.tools.ant.taskdefs.optional.clearcase.CCMkelem, org.apache.tools.ant.taskdefs.optional.clearcase.CCMklabel, org.apache.tools.ant.taskdefs.optional.clearcase.CCMklbtype, org.apache.tools.ant.taskdefs.optional.clearcase.CCRmtype, org.apache.tools.ant.taskdefs.optional.clearcase.CCUnCheckout, org.apache.tools.ant.taskdefs.optional.clearcase.CCUnlock, org.apache.tools.ant.taskdefs.optional.clearcase.CCUpdate
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.taskdefs.ExecTask, .Execute, .LogStreamHandler, org.apache.tools.ant.types.Commandline, org.apache.tools.ant.util.FileUtils

A base class for creating tasks for executing commands on ClearCase.

By default the task expects the cleartool executable to be in the path, you can override this be specifying the cleartooldir attribute.

This class provides set and get methods for the 'viewpath' and 'objselect' attribute. It also contains constants for the flags that can be passed to cleartool.

Field Summary

Modifier and TypeField and Description
private static final String
CLEARTOOL_EXE

Constant for the thing to execute

public static final String
COMMAND_CHECKIN

The 'Checkin' command

public static final String
COMMAND_CHECKOUT

The 'Checkout' command

public static final String
COMMAND_LOCK

The 'Lock' command

public static final String
COMMAND_LSCO

The 'LsCheckout' command

public static final String
COMMAND_MKATTR

The 'Mkattr' command

public static final String
COMMAND_MKBL

The 'Mkbl' command

public static final String
COMMAND_MKDIR

The 'Mkdir' command

public static final String
COMMAND_MKELEM

The 'Mkelem' command

public static final String
COMMAND_MKLABEL

The 'Mklabel' command

public static final String
COMMAND_MKLBTYPE

The 'Mklbtype' command

public static final String
COMMAND_RMTYPE

The 'Rmtype' command

public static final String
COMMAND_UNCHECKOUT

The 'UndoCheckout' command

public static final String
COMMAND_UNLOCK

The 'Unlock' command

public static final String
COMMAND_UPDATE

The 'Update' command

private String
private boolean
private String
private String
private int
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final String

Returns:

String containing path to the executable
getClearToolCommand
()

Builds and returns the command string to execute cleartool

public boolean

Returns:

boolean containing status of failonerr flag
getFailOnErr
()

Get failonerr flag status

public String

Returns:

mobjSelect
getObjSelect
()

Get the object to operate on

public String

Returns:

mviewPath
getViewPath
()

Get the path to the item in a clearcase view

public String

Returns:

basename
getViewPathBasename
()

Get the basename path of the item in a clearcase view

protected int

Returns:

the exit status of the subprocess or INVALID
run
(Commandline
command line to execute
cmd
)

Execute the given command are return success or failure

protected String

Returns:

output of the command line
runS
(Commandline
command line to execute
cmdline
)

Deprecated use the two arg version instead
Execute the given command, and return it's output
protected String

Returns:

output of the command line
runS
(Commandline
command line to execute
cmdline
,
boolean
whether to fail the build if the command fails
failOnError
)

Execute the given command, and return it's output

public final void
setClearToolDir(String
the directory containing the cleartool executable
dir
)

Set the directory where the cleartool executable is located.

public void
setFailOnErr(boolean
the status to set the flag to
failonerr
)

If true, command will throw an exception on failure.

public final void
setObjSelect(String
object to operate on
objSelect
)

Set the object to operate on.

public final void
setViewPath(String
Path to the view directory or file
viewPath
)

Set the path to the item in a ClearCase view to operate on.

Inherited from org.apache.tools.ant.Task:
bindToOwnerexecutegetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

CLEARTOOL_EXEback to summary
private static final String CLEARTOOL_EXE

Constant for the thing to execute

COMMAND_CHECKINback to summary
public static final String COMMAND_CHECKIN

The 'Checkin' command

COMMAND_CHECKOUTback to summary
public static final String COMMAND_CHECKOUT

The 'Checkout' command

COMMAND_LOCKback to summary
public static final String COMMAND_LOCK

The 'Lock' command

COMMAND_LSCOback to summary
public static final String COMMAND_LSCO

The 'LsCheckout' command

COMMAND_MKATTRback to summary
public static final String COMMAND_MKATTR

The 'Mkattr' command

COMMAND_MKBLback to summary
public static final String COMMAND_MKBL

The 'Mkbl' command

COMMAND_MKDIRback to summary
public static final String COMMAND_MKDIR

The 'Mkdir' command

COMMAND_MKELEMback to summary
public static final String COMMAND_MKELEM

The 'Mkelem' command

COMMAND_MKLABELback to summary
public static final String COMMAND_MKLABEL

The 'Mklabel' command

COMMAND_MKLBTYPEback to summary
public static final String COMMAND_MKLBTYPE

The 'Mklbtype' command

COMMAND_RMTYPEback to summary
public static final String COMMAND_RMTYPE

The 'Rmtype' command

COMMAND_UNCHECKOUTback to summary
public static final String COMMAND_UNCHECKOUT

The 'UndoCheckout' command

COMMAND_UNLOCKback to summary
public static final String COMMAND_UNLOCK

The 'Unlock' command

COMMAND_UPDATEback to summary
public static final String COMMAND_UPDATE

The 'Update' command

mClearToolDirback to summary
private String mClearToolDir
mFailonerrback to summary
private boolean mFailonerr
mobjSelectback to summary
private String mobjSelect
mviewPathback to summary
private String mviewPath
pcntback to summary
private int pcnt

Constructor Detail

ClearCaseback to summary
public ClearCase()

Method Detail

getClearToolCommandback to summary
protected final String getClearToolCommand()

Builds and returns the command string to execute cleartool

Returns:String

String containing path to the executable

getFailOnErrback to summary
public boolean getFailOnErr()

Get failonerr flag status

Returns:boolean

boolean containing status of failonerr flag

Since
ant 1.6.1
getObjSelectback to summary
public String getObjSelect()

Get the object to operate on

Returns:String

mobjSelect

getViewPathback to summary
public String getViewPath()

Get the path to the item in a clearcase view

Returns:String

mviewPath

getViewPathBasenameback to summary
public String getViewPathBasename()

Get the basename path of the item in a clearcase view

Returns:String

basename

runback to summary
protected int run(Commandline cmd)

Execute the given command are return success or failure

Parameters
cmd:Commandline

command line to execute

Returns:int

the exit status of the subprocess or INVALID

runSback to summary
protected String runS(Commandline cmdline)

Deprecated

use the two arg version instead

Execute the given command, and return it's output

Parameters
cmdline:Commandline

command line to execute

Returns:String

output of the command line

Annotations
@Deprecated
runSback to summary
protected String runS(Commandline cmdline, boolean failOnError)

Execute the given command, and return it's output

Parameters
cmdline:Commandline

command line to execute

failOnError:boolean

whether to fail the build if the command fails

Returns:String

output of the command line

Since
Ant 1.10.6
setClearToolDirback to summary
public final void setClearToolDir(String dir)

Set the directory where the cleartool executable is located.

Parameters
dir:String

the directory containing the cleartool executable

setFailOnErrback to summary
public void setFailOnErr(boolean failonerr)

If true, command will throw an exception on failure.

Parameters
failonerr:boolean

the status to set the flag to

Since
ant 1.6.1
setObjSelectback to summary
public final void setObjSelect(String objSelect)

Set the object to operate on.

Parameters
objSelect:String

object to operate on

setViewPathback to summary
public final void setViewPath(String viewPath)

Set the path to the item in a ClearCase view to operate on.

Parameters
viewPath:String

Path to the view directory or file