CvsTask

Extends \Task

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 hans@xmpl.org (Phing)

author

costin@dnt.ro (Ant)

author

stefano@apache.org (Ant)

author

Wolfgang Werner wwerner@picturesafe.de (Ant)

author

Kevin Ross kevin.ross@bredex.com (Ant)

version

$Id: c8232b68045eec9d40b1bda18c4b758c6cfbd80f $

package

phing.tasks.system

Methods

This needs to be public to allow configuration of commands externally.

appendCommandArgument( $arg) 

Arguments

$arg

Configure a commandline element for things like cvsRoot, quiet, etc.

configureCommandline( $c) : string

Arguments

$c

Response

string

getCommand

getCommand() : null

Response

null

getCvsRoot

getCvsRoot() 

getCvsRsh

getCvsRsh() 

Returns the textual description of the task

getDescription() : string
inherited

Response

string

The text description of the task

getDest

getDest() : \File

Response

\File

Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.

getLocation() : \Location
inherited

Response

\Location

The location object describing the position of this

             task within the buildfile.

getModule

getModule() 

Returns the owning target of this task.

getOwningTarget() : \Target
inherited

Response

\Target

The target object that owns this task

getPassFile

getPassFile() : \File

Response

\File

getPort

getPort() : integer

Response

integer

Returns a reference to current project

getProject() : \Project
inherited

Response

\Project

Reference to current porject object

Returns a name

getRegisterSlot(string $slotName) : \RegisterSlot
inherited

Arguments

$slotName

string

Response

\RegisterSlot

Returns the wrapper object for runtime configuration

getRuntimeConfigurableWrapper() : \RuntimeConfigurable
inherited

Response

\RuntimeConfigurable

The wrapper object used by this task

Returns the name of task, used only for log messages

getTaskName() : string
inherited

Response

string

Name of this task

Returns the name of the task under which it was invoked, usually the XML tagname

getTaskType() : string
inherited

Response

string

The type of this task (XML Tag)

Called by the parser to let the task initialize properly.

init() 
inherited

Should throw a BuildException if something goes wrong with the build

This is abstract here, but may not be overloaded by subclasses.

throws

Logs a message with the given priority.

log(string $msg, integer $level = \Project::MSG_INFO) : void
inherited

Arguments

$msg

string

The message to be logged.

$level

integer

The message's priority at this message should have

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 <em>phing target1 target2</em> will run all tasks in target3 twice.

main() 
inherited abstract

Should throw a BuildException if someting goes wrong with the build

This is abstract here. Must be overloaded by real tasks.

Configure this task if it hasn't been done already.

maybeConfigure() 
inherited

Perfrom this task

perform() 
inherited
throws

removeCommandline

removeCommandline(\Commandline $c) : boolean

Arguments

Response

boolean

Sets up the environment for toExecute and then runs it.

runCommand(\Commandline $toExecute) 
throws

Arguments

$toExecute

\Commandline

The CVS command to execute.

setCommand(string $c) 

Arguments

$c

string

If true, this is the same as compressionlevel="3".

setCompression(boolean $usecomp) 

Arguments

$usecomp

boolean

If true, turns on compression using default

                    level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL.

If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.

setCompressionLevel(integer $level) 

Arguments

$level

integer

The CVSROOT variable.

setCvsRoot(string $root) 

Arguments

$root

string

The CVS_RSH variable.

setCvsRsh( $rsh) 

Arguments

$rsh

Use the most recent revision no later than the given date.

setDate( $p) 

Arguments

$p

Sets a textual description of the task

setDescription(string $desc) 
inherited

Arguments

$desc

string

The text describing the task

The directory where the checked out files should be placed.

setDest(\PhingFile $dest) 

Arguments

$dest

\PhingFile

Stop the build process if the command exits with a return code other than 0.

setFailOnError(boolean $failOnError) 

Defaults to false.

Arguments

$failOnError

boolean

Sets the location within the buildfile this task occurs. Called by the parser to set location information.

setLocation(\Location $location) 
inherited

Arguments

$location

\Location

The location object describing the position of this

                      task within the buildfile.

If true, report only and don't change any files.

setNoexec(boolean $ne) 

Arguments

$ne

boolean

Sets the owning target this task belongs to.

setOwningTarget(\Target $target) 
inherited

Arguments

$target

\Target

Port used by CVS to communicate with the server.

setPort(integer $port) 

Arguments

$port

integer

References the project to the current component.

setProject(\Project $project) : void
inherited

Arguments

$project

\Project

The reference to the current project

If true, suppress informational messages.

setQuiet(boolean $q) 

Arguments

$q

boolean

Sets the wrapper object this task should use for runtime configurable elements.

setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper) 
inherited

Arguments

$wrapper

\RuntimeConfigurable

The wrapper object this task should use

The tag of the package/module to operate upon.

setTag(string $p) 

Arguments

$p

string

Sets the name of this task for log messages

setTaskName(string $name) : string
inherited

Arguments

$name

string

Response

string

A string representing the name of this task for log

Sets the type of the task. Usually this is the name of the XML tag

setTaskType( $name) 
inherited

Arguments

$name

Constants

Default compression level to use, if compression is enabled via setCompression( true ).

DEFAULT_COMPRESSION_LEVEL

Properties

cmd

cmd : 

Type(s)

List of Commandline children

commandlines : array
var

Commandline[]

Type(s)

array

the CVSROOT variable.

cvsRoot : 

Type(s)

the CVS_RSH variable.

cvsRsh : 

Type(s)

the package/module to check out.

cvsModule : 

Type(s)

the default command.

default_command : 
static

Type(s)

the CVS command to execute.

command : 

Type(s)

suppress information messages.

quiet : 

Type(s)

compression level to use.

compression : 

Type(s)

report only, don't change any files.

noexec : 

Type(s)

CVS port

port : 

Type(s)

CVS password file

passFile : \File
var

Type(s)

\File

the directory where the checked out files should be placed.

dest : \File
var

Type(s)

\File

error

error : 

Type(s)

output

output : 

Type(s)

If true it will stop the build if cvs exits with error.

failOnError : boolean

Default is false. (Iulian)

var

Type(s)

boolean

Owning Target object

target : \Target
inherited
var

Type(s)

\Target

Description of the task

description : string
inherited
var

Type(s)

string

Internal taskname (req)

taskType : string
inherited
var

Type(s)

string

Taskname for logger

taskName : string
inherited
var

Type(s)

string

Stored buildfile location

location : \Location
inherited
var

Type(s)

\Location

Wrapper of the task

wrapper : \RuntimeConfigurable
inherited
var

Type(s)

\RuntimeConfigurable

Holds a reference to the project that a project component (a task, a target, etc.) belongs to

project : \Project
inherited
var

A reference to the current project instance

Type(s)

\Project