
MSBuild properties
Inputs
Input properties are passed to the Git2SemVer MSBuild task.
A property may be defined within a csproj
file or on a command line like:
dotnet build -p:Git2SemVer_UpdateHostBuildLabel=true
Or, in the csproj
file like:
<PropertyGroup>
:
<Git2SemVer_UpdateHostBuildLabel>true</Git2SemVer_UpdateHostBuildLabel>
:
</PropertyGroup>
The MSBuild input poperties are:
Property
|
Description
|
If set, overrides the host's BuildContext property. The build context gives context to the build number. On a build system that provides a build number, like TeamCity, it is not required or set to "0". On an uncontrolled host (dev box) it is the host's machine name as the build number only makes sense in the context of that host. |
If set overrides the build host's BuildIdFormat property to overrides how the host formats build ID
A a dot delimited string of identifiers. Identifiers
Example values: Default is build host dependent. |
Optional value that overrides the host's BuildNumber property. Use this to pass in build number from a build system. Not required if using TeamCity. |
|
Optional regular expression value to map branch name to release and prerelease labels.
Default is
The |
|
Git2SemVer_Disable
|
Set to true to disable Git2SemVer. Default is false.
|
Git2SemVer_HostType
|
If set, overrides automatic host detection. Value values are "Uncontrolled", "TeamCity", or "GitHub".
|
Git2SemVer_ScriptArg
|
A string made that Git2SemVer passes on for the C# script to use.
Not used by Git2SemVer.
|
Git2SemVer_ScriptPath
|
Path, relative to the project's folder, to the C# script file. Provided to allow the script file use a custom name and/or be moved to another folder. Default is Git2SemVer.csx in the project's folder. |
Git2SemVer_UpdateHostBuildLabel
|
Only used if building on a host, such as a TeamCity agent, that supports setting the build's label/version. Then if set to true, and build label will be set to the generated build system version. Default is false. To update the build system's label set this on the command line or in the csproj file. |
Git2SemVer_ReleaseTagFormat
|
Optional regular expression format to identify a release, and get the version, from a Git tag's friendly name. See: Release Tagging Available in Git2SemVer.MSBuild 3.1.0 or later. |
Outputs
Git2SemVer's MSBuild task outputs version information to MSBuild properties. Some of these properties are standard MSBuild properties used by the compiler. The custom properties are provided for third party MSBuild task use.
Standard versioning properties
MSBuild standard versioning properties set are:
- AssemblyVersion
- FileVersion
- InformationalVersion
- PackageVersion
- Version
- VersionPrefix
- VersionSuffix
More information can be found here.
Custom properties
Custom properties set for use by other scripts are:
Property
|
Description
|
Git2SemVer_Output1
|
An output value that may be set by C# script (context.Outputs.Output1). Default is an empty string. Not used by Git2SemVer. |
Git2SemVer_Output2
|
An output value that may be set by C# script (context.Outputs.Output1). Default is an empty string. Not used by Git2SemVer. |