tasks/system/CvsTask.php
Task for performing CVS operations.
NOTE: This implementation has been moved here from Cvs.java with the addition of some accessors for extensibility. Another task can extend this with some customized output processing.
- Author
- Hans Lellelid
(Phing) - Author
- costin@dnt.ro (Ant)
- Author
- stefano@apache.org (Ant)
- Author
- Wolfgang Werner
(Ant) - Author
- Kevin Ross
(Ant) - Package
- phing.tasks.system
- Version
- $Id: 642c6947fa58e02a8c7893c8c4dfab2debfdd51d $
\CvsTask
Task for performing CVS operations.
NOTE: This implementation has been moved here from Cvs.java with the addition of some accessors for extensibility. Another task can extend this with some customized output processing.
- Parent(s)
- \Task < \ProjectComponent
- Author
- Hans Lellelid
(Phing) - Author
- costin@dnt.ro (Ant)
- Author
- stefano@apache.org (Ant)
- Author
- Wolfgang Werner
(Ant) - Author
- Kevin Ross
(Ant) - Copyright
- 2001,2002 THYRELL. All rights reserved
- Version
- $Id: 642c6947fa58e02a8c7893c8c4dfab2debfdd51d $
Constants
Properties


array
$commandlines= 'array()'
List of Commandline children
Commandline[]array()
Details- Type
- array


boolean
$failOnError= 'false'
If true it will stop the build if cvs exits with error.
Default is false. (Iulian)
false
Details- Type
- boolean


\Project
$project= 'null'
Holds a reference to the project that a project component (a task, a target, etc.) belongs to
A reference to the current project instanceInherited from: \ProjectComponent::$$project\Task::$$projectnull
Details- Type
- \Project
- Inherited_from
- \ProjectComponent::$$project
- Inherited_from
- \Task::$$project
Methods


addConfiguredCommandline(
\insertAtStart $c, $insertAtStart
=
false
)
:
void
Configures and adds the given Commandline.
Name | Type | Description |
---|---|---|
$c | \insertAtStart | If true, c is |
$insertAtStart |


appendCommandArgument(
$arg
)
:
void
This needs to be public to allow configuration of commands externally.
Name | Type | Description |
---|---|---|
$arg |


configureCommandline(
$c
)
:
string
Configure a commandline element for things like cvsRoot, quiet, etc.
Name | Type | Description |
---|---|---|
$c |
Type | Description |
---|---|
string |


getLocation(
)
:
\Location
Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.
Inherited from: \Task::getLocation()Type | Description |
---|---|
\Location | The location object describing the position of this task within the buildfile. |


getProject(
)
:
\Project
Returns a reference to current project
Inherited from: \ProjectComponent::getProject()\Task::getProject()Type | Description |
---|---|
\Project | Reference to current porject object |


getRuntimeConfigurableWrapper(
)
:
\RuntimeConfigurable
Returns the wrapper object for runtime configuration
Inherited from: \Task::getRuntimeConfigurableWrapper()Type | Description |
---|---|
\RuntimeConfigurable | The wrapper object used by this task |


getTaskType(
)
:
string
Returns the name of the task under which it was invoked, usually the XML tagname
Inherited from: \Task::getTaskType()Type | Description |
---|---|
string | The type of this task (XML Tag) |


init(
)
:
void
Called by the parser to let the task initialize properly.
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
Exception | Description |
---|---|
\BuildException |


log(
string $msg, integer $level
=
Project::MSG_INFO
)
:
void
Name | Type | Description |
---|---|---|
$msg | string | The message to log |
$level | integer | The priority of the message |
- See
- \BuildEvent
- See
- \BuildListener


main(
)
:
void
Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running phing target1 target2 will run all tasks in target3 twice.
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
Exception | Description |
---|---|
\BuildException |


maybeConfigure(
)
:
void
Configure this task if it hasn't been done already.
Inherited from: \Task::maybeConfigure()

runCommand(
\Commandline $toExecute
)
:
void
Sets up the environment for toExecute and then runs it.
Name | Type | Description |
---|---|---|
$toExecute | \Commandline |
Exception | Description |
---|---|
\BuildException |


setCommand(
string $c
)
:
void
The CVS command to execute.
Name | Type | Description |
---|---|---|
$c | string |


setCompression(
boolean $usecomp
)
:
void
If true, this is the same as compressionlevel="3".
Name | Type | Description |
---|---|---|
$usecomp | boolean | If true, turns on compression using default level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL. |


setCompressionLevel(
int $level
)
:
void
If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.
Name | Type | Description |
---|---|---|
$level | int |


setCvsRoot(
string $root
)
:
void
The CVSROOT variable.
Name | Type | Description |
---|---|---|
$root | string |


setDate(
$p
)
:
void
Use the most recent revision no later than the given date.
Name | Type | Description |
---|---|---|
$p | p |


setDescription(
string $desc
)
:
void
Name | Type | Description |
---|---|---|
$desc | string | The text describing the task |


setDest(
\PhingFile $dest
)
:
void
The directory where the checked out files should be placed.
Name | Type | Description |
---|---|---|
$dest | \PhingFile |


setError(
$f
)
:
void
File to which error output should be written.
Name | Type | Description |
---|---|---|
$f |


setFailOnError(
boolean $failOnError
)
:
void
Stop the build process if the command exits with a return code other than 0.
Defaults to false.
Name | Type | Description |
---|---|---|
$failOnError | boolean |


setLocation(
\Location $location
)
:
void
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Inherited from: \Task::setLocation()Name | Type | Description |
---|---|---|
$location | \Location | The location object describing the position of this task within the buildfile. |


setNoexec(
boolean $ne
)
:
void
If true, report only and don't change any files.
Name | Type | Description |
---|---|---|
$ne | boolean |


setOwningTarget(
\Target $target
)
:
void
Name | Type | Description |
---|---|---|
$target | \Target | Reference to owning target |


setPassfile(
$passFile
)
:
void
Password file to read passwords from.
Name | Type | Description |
---|---|---|
$passFile | passFile |


setPort(
int $port
)
:
void
Port used by CVS to communicate with the server.
Name | Type | Description |
---|---|---|
$port | int |


setProject(
\Project $project
)
:
void
References the project to the current component.
Inherited from: \ProjectComponent::setProject()\Task::setProject()Name | Type | Description |
---|---|---|
$project | \Project | The reference to the current project |


setQuiet(
boolean $q
)
:
void
If true, suppress informational messages.
Name | Type | Description |
---|---|---|
$q | boolean |


setRuntimeConfigurableWrapper(
\RuntimeConfigurable $wrapper
)
:
void
Sets the wrapper object this task should use for runtime configurable elements.
Inherited from: \Task::setRuntimeConfigurableWrapper()Name | Type | Description |
---|---|---|
$wrapper | \RuntimeConfigurable | The wrapper object this task should use |


setTag(
string $p
)
:
void
The tag of the package/module to operate upon.
Name | Type | Description |
---|---|---|
$p | string |


setTaskName(
string $name
)
:
string
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
string | A string representing the name of this task for log |


setTaskType(
string $name
)
:
void
Sets the type of the task. Usually this is the name of the XML tag
Inherited from: \Task::setTaskType()Name | Type | Description |
---|---|---|
$name | string | The type of this task (XML Tag) |