GmodNET.VersionTool.SourceGenerator 2.1.0

dotnet add package GmodNET.VersionTool.SourceGenerator --version 2.1.0                
NuGet\Install-Package GmodNET.VersionTool.SourceGenerator -Version 2.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GmodNET.VersionTool.SourceGenerator" Version="2.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GmodNET.VersionTool.SourceGenerator --version 2.1.0                
#r "nuget: GmodNET.VersionTool.SourceGenerator, 2.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GmodNET.VersionTool.SourceGenerator as a Cake Addin
#addin nuget:?package=GmodNET.VersionTool.SourceGenerator&version=2.1.0

// Install GmodNET.VersionTool.SourceGenerator as a Cake Tool
#tool nuget:?package=GmodNET.VersionTool.SourceGenerator&version=2.1.0                

GmodNET Version Tool

MSBuild Target NuGet Link Class Library NuGet Link CLI Tool NuGet Link

A git-based Semantic Versioning 2.0.0 compatible version number generator.

Description

GmodNET Version Tool generates a version number of the form [FullVersion]+codename.[codename from version JSON file].head.[git head name].commit.[hexadecimal representation of git commit hash].[any additional metadata provided in a "Version" key-value pair of the version JSON file] based on the version file and git repository state.

Version file is a JSON file containing key Version with corresponding value being a Semantic Versioning 2.0.0 compatible version base (initial part of the resulting version) and optional key Codename.

For example, given that repository HEAD points to NewFeature branch and version file

{
  "Version": "0.6.0-beta.1"
}

the resulting version will be equal to

0.6.0-beta.1.943586.NewFeature+head.NewFeature.commit.a3455d90049f17b6ac3bbc54177cfb51b0803851

or given that git HEAD points to master branch and version file

{
  "Version": "1.0.0+bugfix14",
  "Codename": "Ural"
}

the resulting version will be equal to

1.0.0+codename.Ural.head.master.commit.e796d2d62d39256f9c3e55b3648cd2bfb289e7bc.bugfix14.

You can read about version number generation in more detail in the Version Tool specification.

Usage

The most straightforward way to use GmodNET Version Tool with .NET projects is to consume GmodNET.VersionTool.MSBuild NuGet package. Just add package reference and specify version file to use by adding similar ItemGroup to your MSBuild project:

<ItemGroup>
  <PackageReference Include="GmodNET.VersionTool.MSBuild" Version="2.0.0" PrivateAssets="All"/>
  <VersionFile Include="../version.json" />
</ItemGroup>

GmodNET.VersionTool.MSBuild will automatically generate version number and set Version and PackageVersion properties for each build.

GmodNET.VersionTool.SourceGenerator is a C# Source Generator, which provides functionality similar to GmodNET.VersionTool.MSBuild, but embeds build version information directly as C# code.

There is a cross-platform .NET command line tool implementation of GmodNET Version Tool: GmodNET.VersionTool. It can be used from shell or any other build systems like make, cmake, etc.

GmodNET.VersioTool.Core is a NuGet package containing .NET Standard 2.0 class library which can be used to generate version numbers from other .NET applications.

There are no supported framework assets in this package.

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.

Version Downloads Last updated
2.1.0 2,611 11/25/2021