VersionTask Class

Summary

Increments a four-part version number stored in a text file. The resulting version number is written back to the file and exposed using NAnt properties.
Assembly
NAnt.Contrib.dll
Namespace
NAnt.Contrib.Tasks
Base Types
  • Task
graph BT Type-->Base0["Task"] Type["VersionTask"] class Type type-node

Syntax

[TaskName("version")]
public class VersionTask : Task

Remarks

The version number format in the text file is Major.Minor.Build.Revision, e.g. 1.0.5.25.

Set in file.Set in file.Can be incremented by setting the parameter.Can be incremented by setting the parameter.
Major
Minor
Build
Revision

The following NAnt properties are created:

The complete version number, i.e. Major.Minor.Build.RevisionThe major component of the version number.The minor component of the version number.The build component of the version number.The revision component of the version number.
prefix.version
prefix.major
prefix.minor
prefix.build
prefix.revision

Attributes

Type Description
TaskName

Properties

Name Value Summary
BuildType VersionTask.BuildNumberAlgorithm
The algorithm for generating build number. The default is NAnt.Contrib.Tasks.VersionTask.BuildNumberAlgorithm.MonthDay.
Path FileInfo
Path to the file containing the current version number. The default file is 'build.number' in the project base directory.
Prefix string
The string to prefix the properties with. The default is 'buildnumber.'.
RevisionType VersionTask.RevisionNumberAlgorithm
The algorithm for generating revision number. The default is NAnt.Contrib.Tasks.VersionTask.RevisionNumberAlgorithm.Automatic.
StartDate DateTime
Start of project. Date from which to calculate build number. Required if NAnt.Contrib.Tasks.VersionTask.BuildNumberAlgorithm.MonthDay is used as NAnt.Contrib.Tasks.VersionTask.BuildType.

Methods

Name Value Summary
ExecuteTask() void