Skip to content

Commit

Permalink
try to use gitversion
Browse files Browse the repository at this point in the history
:(
  • Loading branch information
drewcassidy committed Aug 31, 2024
1 parent e96eda5 commit 7964daa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Source/Shabby.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="6.0.2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<!-- Static Properties -->
<PropertyGroup>
Expand Down Expand Up @@ -32,12 +38,12 @@
</ItemGroup>

<!-- Target to get information about the git repo -->
<Target Name="GetVersionInfo" BeforeTargets="BeforeBuild">
<Target Name="GetVersionInfo">
<Exec Command="git describe --tags --abbrev=0" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="RepoLatestTag"/>
<Output TaskParameter="ConsoleOutput" PropertyName="RepoLatestTag" />
</Exec>
<Exec Command="git rev-list $(RepoLatestTag)..HEAD --count" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="RepoTagDistance"/>
<Output TaskParameter="ConsoleOutput" PropertyName="RepoTagDistance" />
</Exec>

<!-- Infer the current version from this information -->
Expand Down

0 comments on commit 7964daa

Please sign in to comment.