Use built-in SourceRevisionId instead of git rev-parse HEAD (#19091)

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
This commit is contained in:
Omair Majid 2024-03-25 10:18:59 -04:00 committed by GitHub
parent 3d908e8989
commit 21e0334c65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions

View file

@ -482,9 +482,9 @@
</Target>
<Target Name="GenerateVersionFile"
DependsOnTargets="SetupBundledComponents;GetCommitHash;GenerateFullNuGetVersion">
DependsOnTargets="SetupBundledComponents;GenerateFullNuGetVersion">
<WriteLinesToFile File="$(SdkOutputDirectory).version"
Lines="$(GitCommitHash);$(Version);$(Rid);$(FullNugetVersion);$(SdkFeatureBand)"
Lines="$(SourceRevisionId);$(Version);$(Rid);$(FullNugetVersion);$(SdkFeatureBand)"
Overwrite="true" />
<!-- This is a hack to make the full nuget version available during the publishing step -->

View file

@ -6,12 +6,4 @@
<FullNugetVersion Condition=" '$(VersionSuffixDateStamp)' != '' And '$(VersionSuffixBuildOfTheDay)' != '' ">$(FullNugetVersion).$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay)</FullNugetVersion>
</PropertyGroup>
</Target>
<Target Name="GetCommitHash">
<Exec Command="git rev-parse HEAD"
ConsoleToMSBuild="true"
Condition=" '$(GitCommitHash)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
</Exec>
</Target>
</Project>