GitInfo by Daniel Cazzulino

<PackageReference Include="GitInfo" Version="1.0.33-pre" />

Package Files

0 bytes

 GitInfo 1.0.33-pre

Exposes the following information for use directly from MSBuild, C# and VB: $(GitBranch), ThisAssembly.Git.Branch $(GitCommit), ThisAssembly.Git.Commit $(GitSha), ThisAssembly.Git.Sha $(GitBaseVersionMajor), ThisAssembly.Git.BaseVersion.Major $(GitBaseVersionMinor), ThisAssembly.Git.BaseVersion.Major $(GitBaseVersionPatch), ThisAssembly.Git.BaseVersion.Major $(GitCommits), ThisAssembly.Git.Commits $(GitTag), ThisAssembly.Git.Tag $(GitBaseTag), ThisAssembly.Git.BaseTag $(GitSemVerMajor), ThisAssembly.Git.SemVer.Major $(GitSemVerMinor), ThisAssembly.Git.SemVer.Minor $(GitSemVerPatch), ThisAssembly.Git.SemVer.Patch $(GitSemVerLabel), ThisAssembly.Git.SemVer.Label $(GitSemVerDashLabel), ThisAssembly.Git.SemVer.DashLabel $(GitSemVerSource), ThisAssembly.Git.SemVer.Source The generated code contains only constants, so it can be used to construct your own assembly/file version attributes: [assembly: AssemblyVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + ".0")] [assembly: AssemblyInformationalVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch + "-" + ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)]

<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
  <metadata>
    <id>GitInfo</id>
    <version>1.0.33-pre</version>
    <title>Git and SemVer Info from MSBuild, C# and VB</title>
    <authors>Daniel Cazzulino</authors>
    <owners>Daniel Cazzulino</owners>
    <licenseUrl>https://github.com/kzu/GitInfo/blob/master/LICENSE</licenseUrl>
    <projectUrl>https://github.com/kzu/GitInfo</projectUrl>
    <iconUrl>https://raw.github.com/kzu/GitInfo/master/img/git.png</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Exposes the following information for use directly from MSBuild, C# and VB:
  $(GitBranch), ThisAssembly.Git.Branch
  $(GitCommit), ThisAssembly.Git.Commit
  $(GitSha), ThisAssembly.Git.Sha
  $(GitBaseVersionMajor), ThisAssembly.Git.BaseVersion.Major
  $(GitBaseVersionMinor), ThisAssembly.Git.BaseVersion.Major
  $(GitBaseVersionPatch), ThisAssembly.Git.BaseVersion.Major
  $(GitCommits), ThisAssembly.Git.Commits
  $(GitTag), ThisAssembly.Git.Tag
  $(GitBaseTag), ThisAssembly.Git.BaseTag
  $(GitSemVerMajor), ThisAssembly.Git.SemVer.Major
  $(GitSemVerMinor), ThisAssembly.Git.SemVer.Minor
  $(GitSemVerPatch), ThisAssembly.Git.SemVer.Patch
  $(GitSemVerLabel), ThisAssembly.Git.SemVer.Label
  $(GitSemVerDashLabel), ThisAssembly.Git.SemVer.DashLabel
  $(GitSemVerSource), ThisAssembly.Git.SemVer.Source

The generated code contains only constants, so it can be used to construct your own assembly/file version attributes:

[assembly: AssemblyVersion(ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + ".0")] 
[assembly: AssemblyInformationalVersion(ThisAssembly.Git.SemVer.Major + "." + 
	ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch + "-" + 
	ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)]</description>
    <summary>Access commit information from MSBuild and C#/VB code, and infer SemVer from branch, tag or version file in git repo.</summary>
    <copyright>Copyright 2015</copyright>
    <tags>msbuild git semver scc</tags>
  </metadata>
</package>