C# Class CcNet.Labeller.SvnRevisionLabeller

Inheritance: ILabeller
Show file Open project: neutmute/SvnRevisionLabeller

Private Properties

Property Type Description
CalculateElapsedDays int
CalculateMsRevision int
ParseAssemblyInfoVersion void

Public Methods

Method Description
Generate ( IIntegrationResult resultFromLastBuild ) : string

Returns the label to use for the current build.

Run ( IIntegrationResult result ) : void

Runs the task, given the specified IIntegrationResult, in the specified IProject.

SvnRevisionLabeller ( ) : System

Initializes a new instance of the SvnRevisionLabeller class.

SvnRevisionLabeller ( ISystemClock systemClock ) : System

Initializes a new instance of the SvnRevisionLabeller class.

Protected Methods

Method Description
AppendCommonSwitches ( ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder buffer ) : void

Appends the arguments required to authenticate against Subversion.

GetRevision ( ) : int

Gets the latest Subversion revision by checking the last log entry.

If an error occurs while parsing the Subversion log, the revision number will be returned as a 0.

ParseVersion ( int revision, IIntegrationResult resultFromLastBuild ) : System.Version

Parses a version string.

Quote ( string urlToBeQuoted ) : string

Ensures that the SVN URL is surrounded with quotation marks, so that paths with spaces in them do not cause an exception.

RunSvnProcess ( ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder arguments ) : ProcessResult

Runs the Subversion process.

Private Methods

Method Description
CalculateElapsedDays ( string startDate, System.DateTime currentDate ) : int

Calculates the number of elapsed days.

CalculateMsRevision ( System.DateTime startDate, System.DateTime currentDate ) : int

Calculates the revision using the standard Microsoft format, being the number of seconds since midnight divided by 2.

ParseAssemblyInfoVersion ( ) : void

Instead of taking the major/minor from hard coded cc.net config, parse for it in the source code which is easily settable

Method Details

AppendCommonSwitches() protected method

Appends the arguments required to authenticate against Subversion.
protected AppendCommonSwitches ( ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder buffer ) : void
buffer ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder The argument builder.
return void

Generate() public method

Returns the label to use for the current build.
Thrown when an error occurs while formatting the version number using the various formatting tokens. Thrown when an error occurs while formatting the version number and an argument has not been specified.
public Generate ( IIntegrationResult resultFromLastBuild ) : string
resultFromLastBuild IIntegrationResult IntegrationResult from last build used to determine the next label.
return string

GetRevision() protected method

Gets the latest Subversion revision by checking the last log entry.
If an error occurs while parsing the Subversion log, the revision number will be returned as a 0.
protected GetRevision ( ) : int
return int

ParseVersion() protected method

Parses a version string.
protected ParseVersion ( int revision, IIntegrationResult resultFromLastBuild ) : System.Version
revision int The current revision.
resultFromLastBuild IIntegrationResult The result from last build.
return System.Version

Quote() protected method

Ensures that the SVN URL is surrounded with quotation marks, so that paths with spaces in them do not cause an exception.
protected Quote ( string urlToBeQuoted ) : string
urlToBeQuoted string The URL to be quoted.
return string

Run() public method

Runs the task, given the specified IIntegrationResult, in the specified IProject.
public Run ( IIntegrationResult result ) : void
result IIntegrationResult The label for the current build.
return void

RunSvnProcess() protected method

Runs the Subversion process.
protected RunSvnProcess ( ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder arguments ) : ProcessResult
arguments ThoughtWorks.CruiseControl.Core.Util.ProcessArgumentBuilder The command-line arguments.
return ProcessResult

SvnRevisionLabeller() public method

Initializes a new instance of the SvnRevisionLabeller class.
public SvnRevisionLabeller ( ) : System
return System

SvnRevisionLabeller() public method

Initializes a new instance of the SvnRevisionLabeller class.
public SvnRevisionLabeller ( ISystemClock systemClock ) : System
systemClock ISystemClock The system clock implementation that will be used when calculating date-based /// revision numbers.
return System