Fallback to commitcount for msi version when doing builds in CI or locally. For official builds it will use the patch number calculated by arcade.
This commit is contained in:
parent
34b644977c
commit
56c36dfd3a
1 changed files with 13 additions and 0 deletions
|
@ -55,9 +55,22 @@
|
|||
<MSBuildExtensionsOutputDirectory>$(LayoutDirectory)MSBuildExtensions</MSBuildExtensionsOutputDirectory>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="git rev-list --count HEAD"
|
||||
ConsoleToMSBuild="true"
|
||||
Condition=" '$(GitCommitCount)' == '' ">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitCount" />
|
||||
</Exec>
|
||||
|
||||
<Error Condition=" '$(OfficialBuild)' == 'true' And '$(_PatchNumber)' == '' "
|
||||
Text="_PatchNumber should not be empty in an official build. Check if there were changes in Arcade." />
|
||||
|
||||
<PropertyGroup>
|
||||
<GitCommitCount>$(GitCommitCount.PadLeft(6,'0'))</GitCommitCount>
|
||||
|
||||
<!-- This number comes from arcade and combines the date based build number id and the revision (incremental number per day) -->
|
||||
<CombinedBuildNumberAndRevision>$(_PatchNumber)</CombinedBuildNumberAndRevision>
|
||||
<!-- Fallback to commit count when patch number is not set. This happens only during CI. -->
|
||||
<CombinedBuildNumberAndRevision Condition=" '$(CombinedBuildNumberAndRevision)' == '' ">$(GitCommitCount)</CombinedBuildNumberAndRevision>
|
||||
<SDKBundleVersion>$(VersionPrefix).$(CombinedBuildNumberAndRevision)</SDKBundleVersion>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue