org.apache.tools.ant.taskdefs.optional.perforce
Class P4Base
public abstract class P4Base
Base class for Perforce (P4) ANT tasks. See individual task for example usage.
protected String | P4Client - Perforce Client (eg myclientspec)
|
protected String | P4CmdOpts - Perforce command opts.
|
protected String | P4Opts - Perforce 'global' opts.
|
protected String | P4Port - Perforce Server Port (eg KM01:1666)
|
protected String | P4User - Perforce User (eg fbloggs)
|
protected String | P4View - Perforce view for commands.
|
protected boolean | failOnError - Keep going or fail on error - defaults to fail.
|
protected String | shell - The OS shell to use (cmd.exe or /bin/sh)
|
protected Perl5Util | util - Perl5 regexp in Java - cool eh?
|
protected void | execP4Command(String command) - no usages found for this method
runs a Perforce command without a handler
|
protected void | execP4Command(String command, P4Handler handler) - Execute P4 command assembled by subclasses.
|
String | getErrorMessage() - gets the error message recorded by the Perforce handler
|
boolean | getInError() - gets whether or not the task has encountered an error
|
void | init() - sets attributes Port, Client, User from properties
if these properties are defined.
|
void | setClient(String P4Client) - The p4 client spec to use;
optional, defaults to the current user
|
void | setCmdopts(String P4CmdOpts) - Set extra command options; only used on some
of the Perforce tasks.
|
void | setErrorMessage(String errorMessage) - sets the error message
|
void | setFailonerror(boolean fail) - whether to stop the build (true, default)
or keep going if an error is returned from the p4 command
|
void | setGlobalopts(String P4Opts) - Set global P4 options; Used on all
of the Perforce tasks.
|
void | setInError(boolean inError) - sets the error flag on the task
|
void | setPort(String P4Port) - The p4d server and port to connect to;
optional, default "perforce:1666"
|
void | setUser(String P4User) - The p4 username;
optional, defaults to the current user
|
void | setView(String P4View) - The client, branch or label view to operate upon;
optional default "//...".
|
execute , getDescription , getLocation , getOwningTarget , getRuntimeConfigurableWrapper , getTaskName , getTaskType , getWrapper , handleErrorFlush , handleErrorOutput , handleFlush , handleInput , handleOutput , init , isInvalid , log , log , maybeConfigure , perform , reconfigure , setDescription , setLocation , setOwningTarget , setRuntimeConfigurableWrapper , setTaskName , setTaskType |
P4Client
protected String P4Client
Perforce Client (eg myclientspec)
P4CmdOpts
protected String P4CmdOpts
Perforce command opts.
Forms half of low level API
P4Opts
protected String P4Opts
Perforce 'global' opts.
Forms half of low level API
P4Port
protected String P4Port
Perforce Server Port (eg KM01:1666)
P4User
protected String P4User
Perforce User (eg fbloggs)
P4View
protected String P4View
Perforce view for commands. (eg //projects/foobar/main/source/... )
failOnError
protected boolean failOnError
Keep going or fail on error - defaults to fail.
shell
protected String shell
The OS shell to use (cmd.exe or /bin/sh)
util
protected Perl5Util util
Perl5 regexp in Java - cool eh?
execP4Command
protected void execP4Command(String command)
throws BuildException
no usages found for this method
runs a Perforce command without a handler
command
- the command that one wants to execute
execP4Command
protected void execP4Command(String command,
P4Handler handler)
throws BuildException
Execute P4 command assembled by subclasses.
command
- The command to runhandler
- A P4Handler to process any input and output
getErrorMessage
public String getErrorMessage()
gets the error message recorded by the Perforce handler
getInError
public boolean getInError()
gets whether or not the task has encountered an error
init
public void init()
sets attributes Port, Client, User from properties
if these properties are defined.
Called automatically by UnknownElement
- init in interface Task
setClient
public void setClient(String P4Client)
The p4 client spec to use;
optional, defaults to the current user
P4Client
- the name of the Perforce client spec
setCmdopts
public void setCmdopts(String P4CmdOpts)
Set extra command options; only used on some
of the Perforce tasks.
P4CmdOpts
- command line options going after the particular
Perforce command
setErrorMessage
public void setErrorMessage(String errorMessage)
sets the error message
errorMessage
- line of error output
setFailonerror
public void setFailonerror(boolean fail)
whether to stop the build (true, default)
or keep going if an error is returned from the p4 command
fail
- indicates whether one wants to fail the build if an error comes from the
Perforce command
setGlobalopts
public void setGlobalopts(String P4Opts)
Set global P4 options; Used on all
of the Perforce tasks.
P4Opts
- global options, to use a specific P4Config file for instance
setInError
public void setInError(boolean inError)
sets the error flag on the task
inError
- if true an error has been encountered by the handler
setPort
public void setPort(String P4Port)
The p4d server and port to connect to;
optional, default "perforce:1666"
P4Port
- the port one wants to set such as localhost:1666
setUser
public void setUser(String P4User)
The p4 username;
optional, defaults to the current user
setView
public void setView(String P4View)
The client, branch or label view to operate upon;
optional default "//...".
the view is required for the following tasks :
- p4delete
- p4edit
- p4reopen
- p4resolve
P4View
- the view one wants to use
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.