Skip to content

ehvattum/dotnet-gitversion

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-msbuild-gitversion - Simple git versioning for dotnet cli

dotnet-msbuild-gitversion is a simple tool for stamping the VersionPrefix element in the dotnet core .csproj projects, using GitVersion for generating the version number.

I have not bothered to create a proper integration at this point.

Usage

  • dotnet publish -c release -o {where ever you want it, possibly as a contained lib}

  • create a simple PreBuildEvent like : <PreBuildEvent>dotnet my-chosen-destination\dotnet-msbuild-gitversion.dll</PreBuildEvent> that uses the dotnet cli To make it work with cmd aswell, use a build target instead, that way, the SDK-implicit target is inported, and we can get nice things like the directory-variable below

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
     <Exec Command="dotnet $(SolutionDir)lib\dotnet-msbuild-gitversion\dotnet-msbuild-gitversion.dll" />
 </Target>

Heavily based on https://github.com/ah-/dotnet-gitversion from Andreas Heider

About

Stamps semver into <VersionPrefix> in .csproj files in new dot net core apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%