Class CvsVersion
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractCvsTask
org.apache.tools.ant.taskdefs.cvslib.CvsVersion
- All Implemented Interfaces:
Cloneable
this task allows to find out the client and the server version of a
CVS installation
example usage :
<cvsversion
cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
passfile="c:/programme/cygwin/home/antoine/.cvspass"
clientversionproperty="apacheclient"
serverversionproperty="apacheserver" />
the task can be used also in the API by calling its execute method,
then calling getServerVersion and/or getClientVersion
- Since:
- ant 1.6.1
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractCvsTask
AbstractCvsTask.Module -
Field Summary
Fields inherited from class AbstractCvsTask
DEFAULT_COMPRESSION_LEVELModifier and TypeFieldDescriptionstatic final intDefault compression level to use, if compression is enabled via setCompression(true).Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()the execute method running CvsVersionGet the CVS client versionGet the CVS server versionvoidsetClientVersionProperty(String clientVersionProperty) Set a property where to store the CVS client versionvoidsetServerVersionProperty(String serverVersionProperty) Set a property where to store the CVS server versionbooleanFind out if the server version supports log with S optionMethods inherited from class AbstractCvsTask
addCommandArgument, addCommandArgument, addConfiguredCommandline, addConfiguredCommandline, addModule, configureCommandline, getCommand, getCvsRoot, getCvsRsh, getDest, getErrorStream, getExecuteStreamHandler, getModules, getOutputStream, getPackage, getPassFile, getPort, getTag, removeCommandline, runCommand, setAppend, setCommand, setCompression, setCompressionLevel, setCvsRoot, setCvsRsh, setDate, setDest, setError, setErrorStream, setExecuteStreamHandler, setFailOnError, setNoexec, setOutput, setOutputStream, setPackage, setPassfile, setPort, setQuiet, setReallyquiet, setTagModifier and TypeMethodDescriptionvoidaddCommandArgument(String arg) This needs to be public to allow configuration of commands externally.voidaddCommandArgument(Commandline c, String arg) This method adds a command line argument to an external command.voidAdds direct command-line to execute.voidaddConfiguredCommandline(Commandline c, boolean insertAtStart) Configures and adds the given Commandline.voidadd a named module/package.protected voidConfigure a commandline element for things like cvsRoot, quiet, etc.accessor to a command line as string This should be deprecated AntoineLL July 23d 2003access the CVSROOT variableaccess the CVS_RSH variablegetDest()get the file where the checked out files should be placedprotected OutputStreamaccess 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 systemprotected ExecuteStreamHandlerfind the handler and instantiate it if it does not exist yetprotected List<AbstractCvsTask.Module> protected OutputStreamaccess 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 systemaccess the package or module to operate uponfind the password fileintgetPort()access the port of CVSgetTag()tag or branchprotected voidremove a particular command from a vector of command linesprotected voidrunCommand(Commandline toExecute) Sets up the environment for toExecute and then runs it.voidsetAppend(boolean value) Whether to append output/error when redirecting to a file.voidsetCommand(String c) The CVS command to execute.voidsetCompression(boolean usecomp) If true, this is the same as compressionlevel="3".voidsetCompressionLevel(int level) If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.voidsetCvsRoot(String root) The CVSROOT variable.voidThe CVS_RSH variable.voidUse the most recent revision no later than the given date.voidThe directory where the checked out files should be placed.voidThe file to direct standard error from the command.protected voidsetErrorStream(OutputStream errorStream) sets a stream to which the stderr from the cvs exe should govoidsets the handlervoidsetFailOnError(boolean failOnError) Stop the build process if the command exits with a return code other than 0.voidsetNoexec(boolean ne) If true, report only and don't change any files.voidThe file to direct standard output from the command.protected voidsetOutputStream(OutputStream outputStream) sets a stream to which the output from the cvs executable should be sentvoidsetPackage(String p) The package/module to operate upon.voidsetPassfile(File passFile) Password file to read passwords from.voidsetPort(int port) Port used by CVS to communicate with the server.voidsetQuiet(boolean q) If true, suppress informational messages.voidsetReallyquiet(boolean q) If true, suppress all messages.voidThe tag of the package/module to operate upon.Methods inherited from class Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.voidinit()Called by the project to let the task initialize properly.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Constructor Details
-
CvsVersion
public CvsVersion()
-
-
Method Details
-
getClientVersion
-
getServerVersion
-
setClientVersionProperty
Set a property where to store the CVS client version- Parameters:
clientVersionProperty- property for CVS client version
-
setServerVersionProperty
Set a property where to store the CVS server version- Parameters:
serverVersionProperty- property for CVS server version
-
supportsCvsLogWithSOption
public boolean supportsCvsLogWithSOption()Find out if the server version supports log with S option- Returns:
- boolean indicating if the server version supports log with S option
-
execute
public void execute()the execute method running CvsVersion- Overrides:
executein classAbstractCvsTask
-