# <stautolabel>

Task for supporting labeling of repositories with incremented version numbers. The version number calculated will be concatenated to the `label`.

Instruments root of repository with `versionnumber.xml` file.

If this file is not present, it is created and checked into StarTeam. The default version number is 1.0.0. By default the build number is incremented. Properties are present to allow setting and incrementing of major, minor, and build versions.

When label is created, properties are set to expose version information and the new label :

- label
- Version.text
- Version.major
- Version.minor
- Version.build

Note: Incrementing or setting major or minor versions does NOT reset the build version.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
buildversion | int | Build version number used for label. If this value is set. `incrementbuild` is ignored. | False
incrementbuild | bool | Increment build version number. The default is true. If `buildversion` is set, this property is ignored. | False
incrementmajor | bool | Increment major version number. The default is false. If `majorversion` is set, this property is ignored. | False
incrementminor | bool | Increment minor version number. The default is false. If `minorversion` is set, this property is ignored. | False
majorversion | int | Major version number used for label. If this value is set, `incrementmajor` is ignored. | False
minorversion | int | Minor version number used for label. If this value is set, `incrementminor` is ignored. | False
versionfile | string | Allows user to specify the filename where the version xml is stored. The default is `versionnumber.xml`. | False
label | string | The name to be given to the label; required. | True
buildlabel | bool | Should label be marked build : default is true | False
description | string | Optional description of the label to be stored in the StarTeam project. | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
password | string | The password used for login. | False
projectname | string | The name of the StarTeam project to be acted on | False
revisionlabel | bool | Should label created be a revision label. The default is false. | False
servername | string | Name of StarTeamServer. | False
serverport | string | Port number of the StarTeam connection. | False
timestamp | string | Optional: If this property is set the label will be created as of the datetime specified. Please provide a datetime format that can be parsed via Parse. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
url | string | One stop to set all parameters needed to connect to a StarTeam server. | False
username | string | The StarTeam user name used for login. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False
viewname | string | The name of the StarTeam view to be acted on. | False

### Examples

- Increment the build version.

      <stautolabel url="${ST.url}" />

- Set the major version.

      <stautolabel majorversion="2" url="${ST.url}" />

- Increment the minor version.

      <stautolabel incrementminor="true" url="${ST.url}" />

- Example `versionnumber.xml` file.

      <?xml version="1.0"?>
      <stautolabel>
          <version major="1" minor="0" build="0" />
      </stautolabel>

### Requirements

Assembly: NAnt.Contrib.Tasks (0.85.2479.0)