Table of Contents

Interface IBuildHost

Namespace
NoeticTools.Git2SemVer.Framework.Framework.BuildHosting
Assembly
NoeticTools.Git2SemVer.Framework.dll

The detected or set build host's properties.

public interface IBuildHost : IDisposable
Inherited Members

Properties

BuildContext

A context/extension of the build number property to better support GitHub and uncontrolled hosts.

string BuildContext { get; set; }

Property Value

string

Remarks

For optional C# script use.

BuildId

The host's build ID.

IReadOnlyList<string> BuildId { get; }

Property Value

IReadOnlyList<string>

Remarks

The build ID is constructed from the host's BuildNumber and BuildContext using format return from BuildIdFormat. On build systems that provide a build number for every build it is the BuildNumber.

BuildIdFormat

The format for generating the host's BuildId.

string BuildIdFormat { get; set; }

Property Value

string

Remarks

The build ID is constructed from the host's BuildNumber and BuildContext using format return from BuildIdFormat. On build systems that provide a build number for every build it is the BuildNumber.

The default value is host dependent. This property can be set by the MSBuild Git2SemVer_BuildIDFormat property.

BuildNumber

Host provided build number.

string BuildNumber { get; set; }

Property Value

string

Remarks

It is best practice for a build number to be an increasing integer value that uniquely identifies a build on the host. For builds made on a build system (a controlled host) the build number provides traceability to the build.

On uncontrolled hosts, such as developer machines, cannot provide a build number that gives reliable traceability. On these hosts the build number is often replaced with an uncontrolled build ID that is often generated using a count of commits since a point or similar. These build IDs cannot be reliably unique. To mitigate duplication issues additional information such as branch name, commit ID, and/or host name are included.

This build number is a string do accomodate both build numbers and build IDs and will be an empty string if the host does not provide a build number.

HostTypeId

The host's type ID. Gives an ID for the type of host detected or set.

HostTypeIds HostTypeId { get; }

Property Value

HostTypeIds

Name

Build host type name defined by HostTypeIds. e.g: "TeamCity".

string Name { get; }

Property Value

string

Methods

BumpBuildNumber()

Used internally to bump the host's build number. Not supported on most hosts.

string BumpBuildNumber()

Returns

string

Remarks

Do not use in C# script. Internal use only.

ReportBuildStatistic(string, double)

Report a build statistic to the host. Does nothing if the host does not support build statistics.

void ReportBuildStatistic(string key, double value)

Parameters

key string
value double

Remarks

Currently only supported for TeamCity hosts. See TeamCity - Reporting build statistics

ReportBuildStatistic(string, int)

Report a build statistic to the host. Does nothing if the host does not support build statistics.

void ReportBuildStatistic(string key, int value)

Parameters

key string
value int

Remarks

Currently only supported for TeamCity hosts. See TeamCity - Reporting build statistics

SetBuildLabel(string)

Set the host's build label. Does nothing if not supported on the host.

void SetBuildLabel(string label)

Parameters

label string

Remarks

Use to display semantic version on a build system.

Currently only supported for TeamCity hosts. See TeamCity - Reporting build number