All Projects → dasMulli → SimpleGitVersion

dasMulli / SimpleGitVersion

Licence: MIT license
Simple Git prerelease versioning integrated into SDK-based msbuild projects

Projects that are alternatives of or similar to SimpleGitVersion

BakingSheet
Easy datasheet management for C# and Unity. Supports Excel, Google Sheet, JSON and CSV format.
Stars: ✭ 144 (+747.06%)
Mutual labels:  nuget-package
EmptyLicensesLicx
Easy continuous integration of apps using third-party controls that rely on licenses.licx files
Stars: ✭ 57 (+235.29%)
Mutual labels:  msbuild
versioning
Prevents update conflicts in Laravel
Stars: ✭ 35 (+105.88%)
Mutual labels:  versioning
deblibs-gradle-plugin
A Gradle plugin that creates Github issue and Slack message for outdated dependencies so they can easily be tracked and manually upgraded.
Stars: ✭ 73 (+329.41%)
Mutual labels:  versioning
MvsSln
🧩 Customizable VisualStudio .sln parser, Complex support of the projects (.vcxproj, .csproj., …), Pluginable lightweight r/w handlers at runtime, and more …
Stars: ✭ 86 (+405.88%)
Mutual labels:  msbuild
express-routes-versioning
Node.js module provides versioning for expressjs routes/api
Stars: ✭ 57 (+235.29%)
Mutual labels:  versioning
aspnet-api-versioning
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
Stars: ✭ 2,396 (+13994.12%)
Mutual labels:  versioning
AsyncLock
An async/await-friendly lock for .NET, complete with asynchronous waits, safe reëntrance, and more.
Stars: ✭ 106 (+523.53%)
Mutual labels:  nuget-package
msbuild-flame-graph
Turns MSBuild executions into flame graphs
Stars: ✭ 37 (+117.65%)
Mutual labels:  msbuild
versiontag
Bash command to automate tag semantic versioning
Stars: ✭ 40 (+135.29%)
Mutual labels:  versioning
developer
Ermöglicht die Bearbeitung von Templates, Modulen und Aktionen im Dateisystem (also mit einem beliebigen Editor).
Stars: ✭ 84 (+394.12%)
Mutual labels:  versioning
versionaire
Provides an immutable, thread-safe, and semantic version type.
Stars: ✭ 71 (+317.65%)
Mutual labels:  versioning
zerover
0️⃣ Minimalist versioning scheme for devs who can't be bothered.
Stars: ✭ 141 (+729.41%)
Mutual labels:  versioning
app-versioning
A Gradle Plugin for lazily generating Android app's versionCode & versionName from Git tags.
Stars: ✭ 149 (+776.47%)
Mutual labels:  versioning
VersionTrackingPlugin
Version Tracking Plugin for Xamarin and Windows
Stars: ✭ 62 (+264.71%)
Mutual labels:  versioning
EDSDK.NET
.NET wrapper for the Canon EOS camera SDK
Stars: ✭ 29 (+70.59%)
Mutual labels:  nuget-package
Get-EventSession
Script to assist in downloading Microsoft event contents or return session information.
Stars: ✭ 55 (+223.53%)
Mutual labels:  msbuild
vkm
VK music downloader
Stars: ✭ 14 (-17.65%)
Mutual labels:  msbuild
gradle-git-versioning-plugin
This extension will set project version, based on current Git branch or tag.
Stars: ✭ 44 (+158.82%)
Mutual labels:  versioning
TsukiSuite
A toolsuite created to make Unity development easier
Stars: ✭ 23 (+35.29%)
Mutual labels:  nuget-package

Super simple Git prerelease versioning

This is a build utility package that adjusts your csproj / vbproj project's NuGet and AssemblyInformalVersion based on the current git repository's branch name and commit count by making use of the VS 2017 SDK-based project system.

Use it like this in your project:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard1.6</TargetFramework>
        <VersionPrefix>1.2.3</VersionPrefix>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="DasMulli.SimpleGitVersion" Version="1.0.0-*" PrivateAssets="All" />
    </ItemGroup>
</Project>

If you are on the master branch and have 23 commits, the resulting version will be:

1.2.3-master-0000023

If you are on the feature/awesome branch and have 25 commits, the resulting version will be:

1.2.3-feature-awesome-0000025

Define Release labels for known branches

For known branches, you can define custom release lables (think of it as branch name to label dictionary):

<ItemGroup>
  <GitBranchToReleaseLabelMapping Include="master" ReleaseLabel="rc" />
  <GitBranchToReleaseLabelMapping Include="develop" ReleaseLabel="beta" />
</ItemGroup>

If you are on the master branch and have 23 commits, the resulting version will be:

1.2.3-rc-0000023

If you are on the feature/awesome branch and have 25 commits, the resulting version will be:

1.2.3-feature-awesome-0000025

SemVer 2.0.0

For SemVer 2.0.0, you'll want your branch name and commit count be separate prerelease lables, separated by a single dot (.) and no zero-padding for the commit count. This can be enabled by setting the property UseCompatGitVersion to false. Because older NuGet clients and feeds(!!) might not fully support SemVer 2.0.0, the "compatible" SemVer 1.0.0 version is used by default. Note that the support for pre-set VersionSuffix values is limited (there will be a dash).

But if you like to live dangerously, you can easily enable SemVer 2.0.0 versions using:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard1.6</TargetFramework>
        <VersionPrefix>1.2.3</VersionPrefix>
        <UseCompatGitVersion>false</UseCompatGitVersion>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="DasMulli.SimpleGitVersion" Version="1.0.0-*" PrivateAssets="All" />
    </ItemGroup>
</Project>

If you are on the master branch and have 23 commits, the resulting version will be:

1.2.3-master.23

If you are on the feature/awesome branch and have 25 commits, the resulting version will be:

1.2.3-feature-awesome.25

Omit branch name in version suffix but use a custom label

The well-known VersionPrefix is considered while the final version is calculated, so you can define it yourself and tell SimpleGitVersion to not care about branch names:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard1.6</TargetFramework>
        <VersionPrefix>1.2.3</VersionPrefix>
        <VersionSuffix>foo</VersionSuffix>
        <IncludeBranchInGitVersion>false</IncludeBranchInGitVersion>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="DasMulli.SimpleGitVersion" Version="1.0.0-*" PrivateAssets="All" />
    </ItemGroup>
</Project>

If you are on ANY branch and have 23 commits, the resulting version will be:

1.2.3-foo-0000023

Manually disable prerelease version generation

For release builds, you usually want to omit prerelease versions being generated. There is a property that can be used to disable all git version generation: DisableGitVersionSuffix. You can use it like this in your build scripts (not that a prerelease version will still be generated if you set VersionSuffix in your project file):

> dotnet pack /p:DisableGitVersionSuffix=true

More control and re-using the values calculated by SimpleGitVersion

See the msbuild target's inline documentation for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].