XploRe.Versioning.Tools.DotNet
0.3.0
Prefix Reserved
dotnet add package XploRe.Versioning.Tools.DotNet --version 0.3.0
NuGet\Install-Package XploRe.Versioning.Tools.DotNet -Version 0.3.0
<PackageReference Include="XploRe.Versioning.Tools.DotNet" Version="0.3.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add XploRe.Versioning.Tools.DotNet --version 0.3.0
#r "nuget: XploRe.Versioning.Tools.DotNet, 0.3.0"
// Install XploRe.Versioning.Tools.DotNet as a Cake Addin #addin nuget:?package=XploRe.Versioning.Tools.DotNet&version=0.3.0 // Install XploRe.Versioning.Tools.DotNet as a Cake Tool #tool nuget:?package=XploRe.Versioning.Tools.DotNet&version=0.3.0
Automatic SemVer 2.0 Versioning for .NET Builds
Provides MSBuild targets that hook into the .NET build process to automatically generate a SemVer 2.0-compatible version based on the current repository revision.
Supports multiple VCS. The default implementation is compatible with common workflows such as Git/Hg Flow or GitHub Flow. Through several MSBuild injection points the process how version numbers are derived can be influenced to match custom workflows.
Usage
Configuration
Set a version prefix in your project file and define the repository type:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>1.2.0</VersionPrefix>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
</Project>
The version prefix is expected to be of format X.Y.Z
, with a major X
, minor Y
and patch version number Z
.
If the patch or patch and minor version numbers are omitted, they default to 0
.
Additional characters in the version prefix are ignored and will be removed automatically.
The repository type controls what VCS engine is used to retrieve further information on the repository. If no repository type is defined, the repository type is auto-detected by searching for a corresponding source control system metadata-folder in the project root folder.
Activation
To activate automated versioning, add the following package reference to the project file:
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="XploRe.Versioning.Tools.DotNet" Version="0.3.0" PrivateAssets="All" />
</ItemGroup>
</Project>
Setting PrivateAssets
to All
ensures that the package reference is used for building only and will not appear as a
dependency in the NuSpec file of the project.
If a tool is used to add the dependency, the PrivateAssets
property should be set automatically.
During each build, the assembly and package version numbers will now automatically include a SemVer 2.0-compatible tag and build number for development and release candidate builds, as well as build metadata.
Documentation
For the full documentation please visit the repository at:
https://gitlab.com/xplo-re/dotnet/versioning.tools.dotnet
License
Released under the Apache License, Version 2.0.
Copyright © xplo.re IT Services, Michael Maier.
All rights reserved.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.