|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.perforce.p4java.ant.tasks.PerforceTask
public abstract class PerforceTask
Base class for Perforce server and client tasks. It defines some common attributes and methods shared by most Perforce tasks. This class is further extended by a base server and a base client classes.
Perforce tasks requires some basic properties. These properties are respectively retrieved through individual attributes, project-wide properties and environment variables.
ServerTask
,
ClientTask
,
AddTask
,
ChangeTask
,
ChangesTask
,
CounterTask
,
DeleteTask
,
Diff2Task
,
EditTask
,
FilesTask
,
FixTask
,
FstatTask
,
GrepTask
,
HaveTask
,
IntegrateTask
,
JobTask
,
JobsTask
,
LabelTask
,
LabelsyncTask
,
LockTask
,
MoveTask
,
ReopenTask
,
ResolveTask
,
RevertTask
,
ShelveTask
,
SubmitTask
,
SyncTask
,
TagTask
,
UnlockTask
,
UnshelveTask
Nested Class Summary | |
---|---|
class |
PerforceTask.Field
This inner class is used for handling nested "field" elements. |
class |
PerforceTask.File
This inner class is used for handling nested "file" elements. |
Field Summary | |
---|---|
protected java.lang.String |
charset
Character set used for translation of unicode files. |
protected java.lang.String |
client
Perforce client workspace. |
protected boolean |
failOnError
If true, it will fail on error, otherwise it will keep on going (default is to fail on error). |
protected java.util.List<PerforceTask.Field> |
fields
Collection of fields (name-value pairs) contained in the "field" nested elements. |
protected static java.lang.String |
FILE_TOKEN_REGEX_PATTERN
Regular expression pattern for splitting a string by whitespace and sequences of characters that begin and end with a quote. |
protected java.util.List<PerforceTask.File> |
fileList
Collection of file and revision specifiers contained in the "file" nested elements. |
protected java.lang.String |
files
Perforce file and revision specifiers, separated by whitespace. |
protected java.util.List<IFileSpec> |
fileSpecs
Collection of file and revision specifiers used as input for the Perforce command. |
protected static java.lang.String |
LINE_PADDING
Line padding. |
protected static java.lang.String |
LINE_SEPARATOR
Line separator for this system. |
protected PerforceMessages |
p4Messages
Perforce message bundle. |
protected java.lang.String |
passwd
Perforce user's password. |
protected java.lang.String |
port
Perforce server host and port. |
protected java.lang.String |
protocol
Perforce server protocol. |
protected java.util.List<IFileSpec> |
retFileSpecs
Collection of file and revision specifiers returned from the Perforce command. |
protected java.lang.String |
retStatusMessage
Result status message returned from the Perforce command. |
protected java.lang.String |
user
Perforce user. |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
PerforceTask()
Default constructor. |
Method Summary | |
---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet fileSet)
This method is use for adding new "fileset" to the collection. |
protected abstract void |
cleanupP4()
Cleanup Perforce server and client instances; logout, disconnect, etc. |
PerforceTask.Field |
createField()
This method is called by an Ant factory method to instantiates a collection of "field" nested elements. |
PerforceTask.File |
createFile()
This method is called by an Ant factory method to instantiates a collection of "file" nested elements. |
protected abstract void |
execP4Command()
Execute the Perforce command. |
void |
execute()
Runs the task. |
protected java.util.Map<java.lang.String,java.lang.String> |
getFields()
Combine all of the fields specified by the "field" nested elements. |
protected java.lang.String[] |
getFiles()
Combine all of the files specified by the "file" attribute, the "file" nested element and Ant's FileSet. |
java.util.List<IFileSpec> |
getFileSpecs()
Gets the file specs. |
java.util.List<IFileSpec> |
getRetFileSpecs()
Gets the ret file specs. |
java.lang.String |
getRetStatusMessage()
Gets the ret status message. |
void |
init()
Inits the. |
protected abstract void |
initP4()
Initialize Perforce server and client instances. |
protected boolean |
isEmpty(java.lang.String value)
Checks if is empty. |
protected void |
logChangelistSummaries(java.util.List<IChangelistSummary> changelistSummaries)
Log the attributes of a list of changelist summaries. |
protected void |
logChangelistSummary(IChangelistSummary changelistSummary)
Log the attributes of a changelist summary. |
protected void |
logExtendedFileSpec(IExtendedFileSpec extendedFileSpec)
Log the attributes of an extended file spec. |
protected void |
logExtendedFileSpecs(java.util.List<IExtendedFileSpec> extendedFileSpecs)
Log the attributes of a list of extended file specs. |
protected void |
logFileDiff(IFileDiff fileDiff)
Log the attributes of a file diff. |
protected void |
logFileDiffs(java.util.List<IFileDiff> fileDiffs)
Log the attributes of a list of file diffs. |
protected void |
logFileLineMatch(IFileLineMatch fileLineMatch)
Log the attributes of a file line match. |
protected void |
logFileLineMatches(java.util.List<IFileLineMatch> fileLineMatches)
Log the attributes of a list of file line matches. |
protected void |
logFileSpec(IFileSpec fileSpec)
Log the attributes of a file spec. |
protected void |
logFileSpecs(java.util.List<IFileSpec> fileSpecs)
Log the attributes of a list of file specs. |
protected void |
logFix(IFix fix)
Log the attributes of a fix. |
protected void |
logFixes(java.util.List<IFix> fixes)
Log the attributes of a list of fixes. |
protected void |
logJob(IJob job)
Log the attributes of a job. |
protected void |
logJobs(java.util.List<IJob> jobs)
Log the attributes of a list of jobs. |
protected int |
parseChangelist(java.lang.String changelist)
Parse the changelist string to a changelist number. |
void |
setCharset(java.lang.String charset)
Sets the charset. |
void |
setClient(java.lang.String client)
Sets the client. |
void |
setFailOnError(boolean failOnError)
Sets the fail on error. |
void |
setFiles(java.lang.String files)
Sets the files. |
void |
setPasswd(java.lang.String passwd)
Sets the passwd. |
void |
setPort(java.lang.String port)
Sets the port. |
void |
setProtocol(java.lang.String protocol)
Sets the protocol. |
void |
setUser(java.lang.String user)
Sets the user. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<PerforceTask.Field> fields
protected java.util.List<PerforceTask.File> fileList
protected PerforceMessages p4Messages
protected static final java.lang.String LINE_SEPARATOR
protected static final java.lang.String LINE_PADDING
protected static final java.lang.String FILE_TOKEN_REGEX_PATTERN
protected java.lang.String protocol
protected java.lang.String port
protected java.lang.String client
protected java.lang.String user
protected java.lang.String passwd
protected java.lang.String charset
protected java.lang.String files
protected boolean failOnError
protected java.util.List<IFileSpec> fileSpecs
protected java.util.List<IFileSpec> retFileSpecs
protected java.lang.String retStatusMessage
Constructor Detail |
---|
public PerforceTask()
Method Detail |
---|
public PerforceTask.Field createField()
public PerforceTask.File createFile()
public void addFileset(org.apache.tools.ant.types.FileSet fileSet)
fileSet
- the file setpublic void setProtocol(java.lang.String protocol)
protocol
- the new protocolpublic void setPort(java.lang.String port)
port
- the new portpublic void setClient(java.lang.String client)
client
- the new clientpublic void setUser(java.lang.String user)
user
- the new userpublic void setPasswd(java.lang.String passwd)
passwd
- the new passwdpublic void setCharset(java.lang.String charset)
charset
- the new charsetpublic void setFiles(java.lang.String files)
files
- the new filespublic void setFailOnError(boolean failOnError)
failOnError
- the new fail on errorpublic java.util.List<IFileSpec> getFileSpecs()
public java.util.List<IFileSpec> getRetFileSpecs()
public java.lang.String getRetStatusMessage()
public void init()
init
in class org.apache.tools.ant.Task
Task.init()
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- the build exceptionTask.execute()
protected abstract void initP4() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- the build exceptionprotected abstract void cleanupP4() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- the build exceptionprotected abstract void execP4Command() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- the build exceptionprotected void logFileSpecs(java.util.List<IFileSpec> fileSpecs)
fileSpecs
- the file specsprotected void logFileSpec(IFileSpec fileSpec)
fileSpec
- the file specprotected void logExtendedFileSpecs(java.util.List<IExtendedFileSpec> extendedFileSpecs)
extendedFileSpecs
- the extended file specsprotected void logExtendedFileSpec(IExtendedFileSpec extendedFileSpec)
extendedFileSpec
- the extended file specprotected void logFileDiffs(java.util.List<IFileDiff> fileDiffs)
fileDiffs
- the file diffsprotected void logFileDiff(IFileDiff fileDiff)
fileDiff
- the file diffprotected void logChangelistSummaries(java.util.List<IChangelistSummary> changelistSummaries)
changelistSummaries
- the changelist summariesprotected void logChangelistSummary(IChangelistSummary changelistSummary)
changelistSummary
- the changelist summaryprotected void logFixes(java.util.List<IFix> fixes)
fixes
- the fixesprotected void logFix(IFix fix)
fix
- the fixprotected void logFileLineMatches(java.util.List<IFileLineMatch> fileLineMatches)
fileLineMatches
- the file line matchesprotected void logFileLineMatch(IFileLineMatch fileLineMatch)
fileLineMatch
- the file line matchprotected void logJobs(java.util.List<IJob> jobs)
jobs
- the jobsprotected void logJob(IJob job)
job
- the jobprotected java.util.Map<java.lang.String,java.lang.String> getFields()
protected java.lang.String[] getFiles()
protected int parseChangelist(java.lang.String changelist)
changelist
- the changelist
protected boolean isEmpty(java.lang.String value)
value
- the value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |