Browse Source

Update Directory.Build.props to set OfficialBuildId on non-PR branches

pull/793/head
Kévin Chalet 7 years ago
committed by GitHub
parent
commit
fbbdee5c67
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      Directory.Build.props

17
Directory.Build.props

@ -37,6 +37,23 @@
<IsShipping>true</IsShipping>
</PropertyGroup>
<!--
Arcade only allows the revision to contain up to two characters, and AppVeyor does not roll-over
build numbers every day like Azure DevOps does. To balance these two requirements, set the official
build ID to be the same format as the built-in default from Arcade, except with the revision number
being the number of the quarter hour of the current time of day (24 * 4 = 96, which is less than 100).
So a build between 00:00 and 00:14 would have a revision of 1, and a build between 23:45 and 23:59:59
would have a revision of 97.
-->
<PropertyGroup Condition=" '$(APPVEYOR)' == 'True' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)' == '' ">
<_Hours>$([MSBuild]::Multiply($([System.DateTime]::Now.ToString(HH)), 4))</_Hours>
<_QuarterHours>$([MSBuild]::Divide($([System.DateTime]::Now.ToString(mm)), 15))</_QuarterHours>
<_QuarterHours>$([System.Math]::Floor($(_QuarterHours)))</_QuarterHours>
<_AppVeyorBuildRevision>$([MSBuild]::Add($(_Hours), $(_QuarterHours)))</_AppVeyorBuildRevision>
<_AppVeyorBuildRevision>$([MSBuild]::Add($(_AppVeyorBuildRevision), 1))</_AppVeyorBuildRevision>
<OfficialBuildId>$([System.DateTime]::Now.ToString(yyyyMMdd)).$(_AppVeyorBuildRevision)</OfficialBuildId>
</PropertyGroup>
<ItemGroup Condition=" '$(OS)' != 'Windows_NT' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2" />
</ItemGroup>

Loading…
Cancel
Save