Awesome
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.
Package | Version |
---|---|
GitBuildInfo.SourceGenerator |
Usage
- Install this package into your project with:
<PackageReference Include="GitBuildInfo.SourceGenerator" IsImplicitlyDefined="true" Version="*-*">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
- 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 setRootNamespace
below)<RootNamespace></RootNamespace>
(Required unless you want the type to be assumed to be in theElskom.Generic.Libs
namespace by the generator)
- The generator package should now run a build task to grab information prior to it executing the generator.