mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 14:27:45 +01:00
feat: add git commit count to assembly info/show in dev bar
This commit is contained in:
parent
d7c6172817
commit
c8a7c69ee0
3 changed files with 39 additions and 3 deletions
|
|
@ -125,6 +125,17 @@
|
|||
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="GetGitCommitCount" BeforeTargets="WriteGitHash" Condition="'$(CommitCount)'==''">
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" rev-list --count HEAD" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitCommitCount" />
|
||||
</Exec>
|
||||
|
||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||
<PropertyGroup>
|
||||
<CommitCount>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitCount), @"\t|\n|\r", ""))</CommitCount>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)'=='' And '$(Configuration)'=='Release'">
|
||||
<!-- write the hash to the temp file.-->
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --long --always --dirty" ConsoleToMSBuild="true">
|
||||
|
|
@ -171,6 +182,10 @@
|
|||
<_Parameter1>GitHash</_Parameter1>
|
||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitCommitCount</_Parameter1>
|
||||
<_Parameter2>$(CommitCount)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHashClientStructs</_Parameter1>
|
||||
<_Parameter2>$(BuildHashClientStructs)</_Parameter2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue