public abstract class AbstractCvsTask extends Task
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCvsTask.Module |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COMPRESSION_LEVEL
Default compression level to use, if compression is enabled via
setCompression( true ).
|
description, location, project
Constructor and Description |
---|
AbstractCvsTask()
empty no-arg constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCommandArgument(Commandline c,
java.lang.String arg)
This method adds a command line argument to an external command.
|
void |
addCommandArgument(java.lang.String arg)
This needs to be public to allow configuration
of commands externally.
|
void |
addConfiguredCommandline(Commandline c)
Adds direct command-line to execute.
|
void |
addConfiguredCommandline(Commandline c,
boolean insertAtStart)
Configures and adds the given Commandline.
|
void |
addModule(AbstractCvsTask.Module m)
add a named module/package.
|
protected void |
configureCommandline(Commandline c)
Configure a commandline element for things like cvsRoot, quiet, etc.
|
void |
execute()
do the work
|
java.lang.String |
getCommand()
accessor to a command line as string
This should be deprecated
AntoineLL July 23d 2003
|
java.lang.String |
getCvsRoot()
access the CVSROOT variable
|
java.lang.String |
getCvsRsh()
access the CVS_RSH variable
|
java.io.File |
getDest()
get the file where the checked out files should be placed
|
protected java.io.OutputStream |
getErrorStream()
access the stream to which the stderr from cvs should go
if this stream has already been set, it will be returned
if the stream has not yet been set, if the attribute error
has been set, the output stream will go to the file denoted by the error attribute
otherwise the stderr output will go to ant's logging system
|
protected ExecuteStreamHandler |
getExecuteStreamHandler()
find the handler and instantiate it if it does not exist yet
|
protected java.util.List |
getModules() |
protected java.io.OutputStream |
getOutputStream()
access the stream to which the stdout from cvs should go
if this stream has already been set, it will be returned
if the stream has not yet been set, if the attribute output
has been set, the output stream will go to the output file
otherwise the output will go to ant's logging system
|
java.lang.String |
getPackage()
access the package or module to operate upon
|
java.io.File |
getPassFile()
find the password file
|
int |
getPort()
access the port of CVS
|
java.lang.String |
getTag()
tag or branch
|
protected void |
removeCommandline(Commandline c)
remove a particular command from a vector of command lines
|
protected void |
runCommand(Commandline toExecute)
Sets up the environment for toExecute and then runs it.
|
void |
setAppend(boolean value)
Whether to append output/error when redirecting to a file.
|
void |
setCommand(java.lang.String c)
The CVS command to execute.
|
void |
setCompression(boolean usecomp)
If true, this is the same as compressionlevel="3".
|
void |
setCompressionLevel(int level)
If set to a value 1-9 it adds -zN to the cvs command line, else
it disables compression.
|
void |
setCvsRoot(java.lang.String root)
The CVSROOT variable.
|
void |
setCvsRsh(java.lang.String rsh)
The CVS_RSH variable.
|
void |
setDate(java.lang.String p)
Use the most recent revision no later than the given date.
|
void |
setDest(java.io.File dest)
The directory where the checked out files should be placed.
|
void |
setError(java.io.File error)
The file to direct standard error from the command.
|
protected void |
setErrorStream(java.io.OutputStream errorStream)
sets a stream to which the stderr from the cvs exe should go
|
void |
setExecuteStreamHandler(ExecuteStreamHandler handler)
sets the handler
|
void |
setFailOnError(boolean failOnError)
Stop the build process if the command exits with
a return code other than 0.
|
void |
setNoexec(boolean ne)
If true, report only and don't change any files.
|
void |
setOutput(java.io.File output)
The file to direct standard output from the command.
|
protected void |
setOutputStream(java.io.OutputStream outputStream)
sets a stream to which the output from the cvs executable should be sent
|
void |
setPackage(java.lang.String p)
The package/module to operate upon.
|
void |
setPassfile(java.io.File passFile)
Password file to read passwords from.
|
void |
setPort(int port)
Port used by CVS to communicate with the server.
|
void |
setQuiet(boolean q)
If true, suppress informational messages.
|
void |
setReallyquiet(boolean q)
If true, suppress all messages.
|
void |
setTag(java.lang.String p)
The tag of the package/module to operate upon.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public static final int DEFAULT_COMPRESSION_LEVEL
public void setExecuteStreamHandler(ExecuteStreamHandler handler)
handler
- a handler able of processing the output and error streams from the cvs exeprotected ExecuteStreamHandler getExecuteStreamHandler()
protected void setOutputStream(java.io.OutputStream outputStream)
outputStream
- stream to which the stdout from cvs should goprotected java.io.OutputStream getOutputStream()
protected void setErrorStream(java.io.OutputStream errorStream)
errorStream
- an output stream willing to process stderrprotected java.io.OutputStream getErrorStream()
protected void runCommand(Commandline toExecute) throws BuildException
toExecute
- the command line to executeBuildException
- if failonError is set to true and the cvs command failspublic void execute() throws BuildException
execute
in class Task
BuildException
- if failonerror is set to true and the
cvs command fails.public void setCvsRoot(java.lang.String root)
root
- the CVSROOT variablepublic java.lang.String getCvsRoot()
public void setCvsRsh(java.lang.String rsh)
rsh
- the CVS_RSH variablepublic java.lang.String getCvsRsh()
public void setPort(int port)
port
- port of CVSpublic int getPort()
public void setPassfile(java.io.File passFile)
passFile
- password file to read passwords frompublic java.io.File getPassFile()
public void setDest(java.io.File dest)
Note that this is different from CVS's -d command line switch as Ant will never shorten pathnames to avoid empty directories.
dest
- directory where the checked out files should be placedpublic java.io.File getDest()
public void setPackage(java.lang.String p)
p
- package or module to operate uponpublic java.lang.String getPackage()
public java.lang.String getTag()
public void setTag(java.lang.String p)
p
- tagpublic void addCommandArgument(java.lang.String arg)
arg
- command argumentpublic void addCommandArgument(Commandline c, java.lang.String arg)
c
- command line to which one argument should be addedarg
- argument to addpublic void setDate(java.lang.String p)
p
- a date as string in a format that the CVS executable
can understand see man cvspublic void setCommand(java.lang.String c)
c
- a command as stringpublic java.lang.String getCommand()
public void setQuiet(boolean q)
q
- if true, suppress informational messagespublic void setReallyquiet(boolean q)
q
- if true, suppress all messagespublic void setNoexec(boolean ne)
ne
- if true, report only and do not change any files.public void setOutput(java.io.File output)
output
- a file to which stdout should gopublic void setError(java.io.File error)
error
- a file to which stderr should gopublic void setAppend(boolean value)
value
- true indicated you want to appendpublic void setFailOnError(boolean failOnError)
failOnError
- stop the build process if the command exits with
a return code other than 0protected void configureCommandline(Commandline c)
c
- the command line which will be configured
if the commandline is initially null, the function is a noop
otherwise the function append to the commandline arguments concerning
protected void removeCommandline(Commandline c)
c
- command line which should be removedpublic void addConfiguredCommandline(Commandline c)
c
- command line to executepublic void addConfiguredCommandline(Commandline c, boolean insertAtStart)
c
- commandline to insertinsertAtStart
- If true, c is
inserted at the beginning of the vector of command linespublic void setCompressionLevel(int level)
level
- compression level 1 to 9public void setCompression(boolean usecomp)
usecomp
- If true, turns on compression using default
level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL.public void addModule(AbstractCvsTask.Module m)
protected java.util.List getModules()