TagTask Class

Summary

Tags all local sources with the specified tag.
graph BT Type-->Base0["AbstractCvsTask"] click Base0 "/api/NAnt.SourceControl.Tasks/AbstractCvsTask" Base0-->Base1["AbstractSourceControlTask"] click Base1 "/api/NAnt.SourceControl.Tasks/AbstractSourceControlTask" Base1-->Base2["ExternalProgramBase"] click Base2 "/api/NAnt.Core.Tasks/ExternalProgramBase" Base2-->Base3["Task"] click Base3 "/api/NAnt.Core/Task" Base3-->Base4["Element"] click Base4 "/api/NAnt.Core/Element" Base4-->Base5["Object"] Type-.->Interface0["IConditional"] click Interface0 "/api/NAnt.Core/IConditional" Type["TagTask"] class Type type-node

Syntax

[TaskName("cvs-tag")]
public class TagTask : AbstractCvsTask, IConditional

Examples

Tag NAnt sources remotely.

<cvs-tag 
cvsroot=":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant" 
destination="."
tag="v0_8_4"
 />

Remove a tag from the remote repository.

<cvs-tag 
cvsroot=":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant" 
destination="."
tag="v0_8_4"
remove="true"
fail-if-modified="true"
 />

Remarks

This differs from the NAnt.SourceControl.Tasks.RTagTask in that it acts on references to the cvs files contained in your local filesystem. As such the sticky tags and local revisions can be considered in commits. It also allows you to verify that all local files have been checked in before a tag is performed.

Attributes

Type Description
TaskNameAttribute Indicates that class should be treated as a task.

Constructors

Name Summary
TagTask() Initializes a new instance of the NAnt.SourceControl.Tasks.TagTask class.

Fields

Name Constant Value Summary
AppData APPDATA
Used on windows to specify the location of application data.
static
CvsExe cvs.exe
The name of the cvs executable.
Inherited from AbstractCvsTask
static
CvsHome CVS_HOME
An environment variable that holds path information about where cvs is located.
Inherited from AbstractCvsTask
static
CvsPassfile .cvspass
Name of the password file that cvs stores pserver cvsroot/ password pairings.
Inherited from AbstractCvsTask
static
CvsPassFileVariable CVS_PASSFILE
The environment variable that holds the location of the .cvspass file.
static
CvsRsh CVS_RSH
Environment variable that holds the executable name that is used for ssh communication.
Inherited from AbstractCvsTask
static
DefaultCompressionLevel 3
The default compression level to use for cvs commands.
Inherited from AbstractCvsTask
static
DefaultQuiet False
Default value for the quiet command.
Inherited from AbstractCvsTask
static
DefaultReallyQuiet False
Default value for the really quiet command.
Inherited from AbstractCvsTask
static
DefaultRecursive False
Default value for the recursive directive. The default is false.
Inherited from AbstractCvsTask
static
DefaultUseSharpCvsLib True
The default use of binaries, defaults to use sharpcvs.
Inherited from AbstractCvsTask
static
EnvHome HOME
Name of the environmental variable specifying a users' home in a *nix environment.
static
PathVariable PATH
The environment variable that holds path information.
static
PropExeName sourcecontrol.exename
Property name used to specify the source control executable. This is used as a readonly property.
static
SharpCvsExe scvs.exe
The temporary name of the sharpcvslib binary file, to avoid conflicts in the path variable.
Inherited from AbstractCvsTask
static
UnknownExitCode -1000
Defines the exit code that will be returned by NAnt.Core.Tasks.ExternalProgramBase.ExitCode if the process could not be started, or did not exit (in time).
Inherited from ExternalProgramBase
static
UseSharpCvsLibProp sourcecontrol.usesharpcvslib
Property name used to specify on a project level whether sharpcvs is used or not.
Inherited from AbstractCvsTask
static

Properties

Name Value Summary
ActOnDate DateTime
Indicates the revision date of the file that the tag should be applied to.
ActOnTag string
Indicates the repository NAnt.SourceControl.Tasks.TagTask.Tag that is acted on for the tag command. Note if NAnt.SourceControl.Tasks.TagTask.MoveIfExists is true then the tag specified is moved to the revision of the file on the HEAD of the branch specified.
Arguments ArgumentCollection
The command-line arguments for the external program.
Inherited from ExternalProgramBase
BaseDirectory DirectoryInfo
Gets the working directory for the application.
Inherited from ExternalProgramBase
CommandLine string
Gets the command-line arguments, separated by spaces.
Inherited from ExternalProgramBase
CommandLineArguments string
Command-line arguments for the program. The command line arguments are used to specify any cvs command options that are not available as attributes. These are appended after the command itself and are additive to whatever attributes are currently specified.
CommandName string
The name of the cvs command that is going to be executed.
CommandOptions Hashtable
A collection of options that can be used to modify the default behavior of the version control commands. See the sub-tasks for implementation specifics.
CompressionLevel int
Compression level to use for all net traffic. This should be a value from 1-9.

NOTE: This is not available on sharpcvslib.
Inherited from AbstractCvsTask
CustomXmlProcessing bool
Gets a value indicating whether the element is performing additional processing using the NAnt.Core.Element.XmlNode that was used to initialize the element.
Inherited from Element
CvsFileSet CvsFileSet
Used to specify the version control system (VCS) files that are going to be acted on.
Inherited from AbstractCvsTask
CvsFullPath FileInfo
The full path to the cvs binary used. The cvs tasks will attempt to "guess" the location of your cvs binary based on your path. If the task is unable to resolve the location, or resolves it incorrectly this can be used to manually specify the path.
Inherited from AbstractCvsTask
DestinationDirectory DirectoryInfo
Destination directory for the local sandbox. If destination is not specified then the current directory is used.
ErrorWriter TextWriter
Gets or sets the System.IO.TextWriter to which error output of the external program will be written.
Inherited from ExternalProgramBase
ExeName string
The name of the cvs executable.
Inherited from AbstractCvsTask
ExitCode int
Gets the value that the process specified when it terminated.
Inherited from ExternalProgramBase
FailIfModified bool
Indicates whether the head revision should be used if the NAnt.SourceControl.Tasks.TagTask.ActOnTag or the NAnt.SourceControl.Tasks.TagTask.ActOnDate tags are not found.
FailOnError bool
Determines if task failure stops the build, or is just reported. The default is true.
Inherited from Task
ForceHead bool
Indicates whether the head revision should be used if the revision specified by NAnt.SourceControl.Tasks.TagTask.ActOnTag or the NAnt.SourceControl.Tasks.TagTask.ActOnDate tags are not found.
GlobalOptions Hashtable
Holds a collection of globally available options.
IfDefined bool
If true then the task will be executed; otherwise, skipped. The default is true.
Inherited from Task
IsModuleNeeded bool
Specify if the module is needed for this cvs command. It is only needed if there is no module information on the local file system.
Location Location
Gets or sets the location in the build file where the element is defined.
Inherited from Element
LogPrefix string
The prefix used when sending messages to the log.
Inherited from Task
Managed ManagedExecution
Specifies whether the external program should be treated as a managed application, possibly forcing it to be executed under the currently targeted version of the CLR.
Inherited from ExternalProgramBase
Module string
Not used
MoveIfExists bool
Indicates whether the tag specified in NAnt.SourceControl.Tasks.TagTask.Tag should be moved to the current file revision. If the tag does not exist then it is created.
Name string
The name of the task.
Inherited from Task
NamespaceManager XmlNamespaceManager
Gets or sets the System.Xml.XmlNamespaceManager.
Inherited from Element
Output FileInfo
Gets the file to which the standard output should be redirected.
Inherited from ExternalProgramBase
OutputAppend bool
Gets a value indicating whether output will be appended to the NAnt.Core.Tasks.ExternalProgramBase.Output.
Inherited from ExternalProgramBase
OutputWriter TextWriter
Gets or sets the System.IO.TextWriter to which standard output messages of the external program will be written.
Inherited from ExternalProgramBase
Parent Object
Gets or sets the parent of the element.
Inherited from Element
PassFile FileInfo
The full path to the cached password file. If not specified then the environment variables are used to try and locate the file.
PassFileName string
The name of the pass file, or .cvspass at the time of this writing.
Inherited from AbstractCvsTask
Password string
The password for logging in to the repository.
ProcessId int
Gets the unique identifier for the spawned application.
Inherited from ExternalProgramBase
ProgramArguments string
Get the command line arguments for the task.
ProgramFileName string
Gets the filename of the external program to start.
Inherited from ExternalProgramBase
Project Project
Gets or sets the NAnt.Core.Element.Project to which this element belongs.
Inherited from Element
Properties PropertyDictionary
Gets the properties local to this NAnt.Core.Element and the NAnt.Core.Element.Project.
Inherited from Element
Quiet bool
Indicates if the output from the cvs command should be suppressed. The default is false.
Inherited from AbstractCvsTask
ReadOnly bool
true if the sandbox files should be checked out in read only mode. The default is false.
Inherited from AbstractCvsTask
ReadWrite bool
true if the sandbox files should be checked out in read/write mode. The default is true.
Inherited from AbstractCvsTask
ReallyQuiet bool
Indicates if the output from the cvs command should be stopped. The default is false.
Inherited from AbstractCvsTask
Recursive bool
If a directory is specified indicates whether sub-directories should also be processed.
Remove bool
Indicates whether the tag specified in NAnt.SourceControl.Tasks.TagTask.Tag should be removed or not.
Root string

The cvs root variable has the following components:

[protocol]:[username]@[servername]:[server path]
  • protocol: ext, pserver, ssh (sharpcvslib); if you are not using sharpcvslib consult your cvs documentation.
  • username: [username]
  • servername: cvs.sourceforge.net
  • server path: /cvsroot/nant

Inherited from AbstractCvsTask
Spawn bool
Gets or sets a value indicating whether the application should be spawned. If you spawn an application, its output will not be logged by NAnt. The default is false.
Inherited from ExternalProgramBase
Ssh FileInfo
The executable to use for ssh communication.
Inherited from AbstractCvsTask
SshEnv string
The environment name for the ssh variable.
Inherited from AbstractCvsTask
Tag string
The name of the tag to assign or remove.
Threshold Level
Gets or sets the log threshold for this NAnt.Core.Task. By default the threshold of a task is NAnt.Core.Level.Debug, causing no messages to be filtered in the task itself.
Inherited from Task
TimeOut int
The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out.
Inherited from ExternalProgramBase
UnlessDefined bool
Opposite of NAnt.Core.Task.IfDefined. If false then the task will be executed; otherwise, skipped. The default is false.
Inherited from Task
UseRuntimeEngine bool
Specifies whether the external program is a managed application which should be executed using a runtime engine, if configured. The default is false.
Inherited from ExternalProgramBase
UseSharpCvsLib bool

true if the SharpCvsLib binaries that come bundled with NAnt should be used to perform the cvs commands, false otherwise.

You may also specify an override value for all cvs tasks instead of specifying a value for each. To do this set the property sourcecontrol.usesharpcvslib to false.

If you choose not to use SharpCvsLib to checkout from cvs you will need to include a cvs.exe binary in your path.
Inherited from AbstractCvsTask
VcsExeName string
The name of the cvs binary, or cvs.exe at the time this was written.
Inherited from AbstractCvsTask
VcsFileSet FileSet
Get the cvs file set.
Inherited from AbstractCvsTask
VcsHome DirectoryInfo
The path to the specific home directory of the version control system, this can be where the binary files are kept, or other app information.
VcsHomeEnv string
The name of the version control system specific home environment variable.
Inherited from AbstractCvsTask
Verbose bool
Determines whether the task should report detailed build log messages. The default is false.
Inherited from Task
XmlNode XmlNode
Gets or sets the XML node of the element.
Inherited from Element

Methods

Name Value Summary
AddArg(string) void
Add the given argument to the command line options. Note that are not explicitly quoted are split into separate arguments. This is to resolve a recent issue with quoting command line arguments.
Inherited from AbstractCvsTask
AppendFiles() void
Append the files specified in the fileset to the command line argument. Files are changed to use a relative path from the working directory that the task is spawned in.
AppendSubCommandArgs() void
Append the tag information to the command line.
CopyTo(Element) void
Copies all instance data of the NAnt.Core.Element to a given NAnt.Core.Element.
Inherited from Element
DeriveVcsFromEnvironment() FileInfo
Derive the location of the version control system from the environment variable
PATH
.
Execute() void
Executes the task unless it is skipped.
Inherited from Task
ExecuteTask() void
Starts the external process and captures its output.
Inherited from ExternalProgramBase
GetAttributeConfigurationNode(FrameworkInfo, string) XmlNode
Locates the XML node for the specified attribute in either the configuration section of the extension assembly or the.project.
Inherited from Task
GetAttributeConfigurationNode(XmlNode, FrameworkInfo, string) XmlNode
Inherited from Element
GetLocation() Location
Retrieves the location in the build file where the element is defined.
Inherited from Element
Initialize() void
Initializes the task.
Inherited from Task
Initialize(XmlNode) void
Performs default initialization.
Inherited from Element
InitializeBuildElement(Element, XmlNode, Element, Type) Element
Initializes the build element.
Inherited from Element
static
InitializeElement(XmlNode) void
Derived classes should override to this method to provide extra initialization and validation not covered by the base class.
Inherited from Element
InitializeTask(XmlNode) void
Initializes the task.
Inherited from Task
InitializeTaskConfiguration() void
Initializes the configuration of the task using configuration settings retrieved from the NAnt configuration file.
Inherited from Task
InitializeXml(XmlNode, PropertyDictionary, FrameworkInfo) void
Initializes all build attributes and child elements.
Inherited from Element
IsLogEnabledFor(Level) bool
Determines whether build output is enabled for the given NAnt.Core.Level.
Inherited from Task
Log(Level, string) void
Logs a message with the given priority.
Inherited from Task
Log(Level, string, Object[]) void
Logs a formatted message with the given priority.
Inherited from Task
PrepareProcess(Process) void
Build up the command line arguments, determine which executable is being used and find the path to that executable and set the working directory.
Inherited from AbstractCvsTask
SetCommandOption(string, string, bool) void
Adds a new command option if none exists. If one does exist then the use switch is toggled on or of.
SetEnvironment(Process) void
Set up the environment variables for a process.
SetGlobalOption(string, string, bool) void
Adds a new global option if none exists. If one does exist then the use switch is toggled on or of.
StartProcess() Process
Starts the process and handles errors.
Inherited from ExternalProgramBase
ToCvsDateTimeString(DateTime) string
Converts a date value to a string representation that can be interpreted by cvs.
Inherited from AbstractCvsTask