Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 1.99 KB

README.md

File metadata and controls

23 lines (19 loc) · 1.99 KB

GitBuildInfo.SourceGenerator

Source Generator for dumping the git branch information, commit hash, and if the working tree is dirty or clean on projects that install this and applies them as an assembly level attribute.

Codacy Badge Codacy Coverage Badge

Package Version
GitBuildInfo.SourceGenerator NuGet Badge

Usage

  1. Install this package into your project with:
<PackageReference Include="GitBuildInfo.SourceGenerator" IsImplicitlyDefined="true" Version="*-*">
  <PrivateAssets>all</PrivateAssets>
</PackageReference>
  1. Set the following msbuild properties in your project (or if you have all project file property settings stored in a project specific Directory.Build.props) file:
  • <GitBuildInfoIsGeneric></GitBuildInfoIsGeneric> (Optional, default is false)
  • <GitBuildInfoAssemblyType></GitBuildInfoAssemblyType> (Required, Note: Do not include anything before the type name like a fully qualified namespace or any .'s. For that you need to set RootNamespace below)
  • <RootNamespace></RootNamespace> (Required unless you want the type to be assumed to be in the Elskom.Generic.Libs namespace by the generator)
  1. The generator package should now run a build task to grab information prior to it executing the generator.