This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
forked from dotnet/extensions
-
Notifications
You must be signed in to change notification settings - Fork 7
/
version.props
66 lines (51 loc) · 4.01 KB
/
version.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<Project>
<PropertyGroup>
<MajorVersion>2</MajorVersion>
<MinorVersion>2</MinorVersion>
<PatchVersion>5</PatchVersion>
<PreReleaseLabel>servicing</PreReleaseLabel>
<OfficialBuildId Condition="'$(OfficialBuildId)' == ''">$(BUILD_BUILDNUMBER)</OfficialBuildId>
</PropertyGroup>
<PropertyGroup Condition=" '$(OfficialBuildId)' != '' ">
<!-- This implements core versioning. Spec: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md -->
<_BuildNumber>$(OfficialBuildId)</_BuildNumber>
<!-- _BuildNumber from CI is assumed to have format "yyyyMMdd.r". -->
<_BuildNumberYY>$(_BuildNumber.Substring(2, 2))</_BuildNumberYY>
<_BuildNumberMM>$(_BuildNumber.Substring(4, 2))</_BuildNumberMM>
<_BuildNumberDD>$(_BuildNumber.Substring(6, 2))</_BuildNumberDD>
<_BuildNumberR>$(_BuildNumber.Substring(9))</_BuildNumberR>
<!-- yy * 1000 + mm * 50 + dd -->
<_BuildNumberShortDate>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</_BuildNumberShortDate>
<VersionSuffixBuildOfTheDay>$([System.Convert]::ToInt32($(_BuildNumberR)))</VersionSuffixBuildOfTheDay>
<VersionSuffixBuildOfTheDayPadded>$(VersionSuffixBuildOfTheDay.PadLeft($([System.Convert]::ToInt32(2)), '0'))</VersionSuffixBuildOfTheDayPadded>
<_BuildNumberSuffix>$(_BuildNumberShortDate)-$(VersionSuffixBuildOfTheDayPadded)</_BuildNumberSuffix>
</PropertyGroup>
<PropertyGroup>
<_BuildNumberSuffix Condition=" '$(_BuildNumberSuffix)' == '' ">t000</_BuildNumberSuffix>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<VersionSuffix>$(PreReleaseLabel)-$(_BuildNumberSuffix)</VersionSuffix>
<ExperimentalVersionPrefix>0.1.$(PatchVersion)</ExperimentalVersionPrefix>
<!-- Servicing builds have different characteristics for the way dependencies, baselines, and versions are handled. -->
<IsServicingBuild Condition=" '$(PreReleaseLabel)' == 'servicing' ">true</IsServicingBuild>
<!-- Run the build with /p:IsFinalBuild=true to produce the product with 'final' branding and versioning -->
<IsFinalBuild Condition=" '$(IsFinalBuild)' == '' ">false</IsFinalBuild>
<IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition=" '$(IsFinalBuild)' == 'true' AND ('$(PreReleaseLabel)' == 'servicing' OR '$(PreReleaseLabel)' == 'rtm')">false</IncludePreReleaseLabelInPackageVersion>
<!-- The version in files -->
<PackageVersion>$(VersionPrefix)</PackageVersion>
<PackageVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<ExperimentalPackageVersion>$(ExperimentalVersionPrefix)</ExperimentalPackageVersion>
<ExperimentalPackageVersion Condition=" '$(IncludePreReleaseLabelInPackageVersion)' == 'true' ">$(VersionPrefix)-$(VersionSuffix)</ExperimentalPackageVersion>
<VersionMetadata Condition=" '$(DotNetProductBuildId)' != '' ">pb-$(DotNetProductBuildId)</VersionMetadata>
<VersionSuffix Condition=" '$(VersionMetadata)' != '' ">$(VersionSuffix)+$(VersionMetadata)</VersionSuffix>
<ExperimentalVersionSuffix>$(VersionSuffix)</ExperimentalVersionSuffix>
<InformationalVersion>$(VersionPrefix)-$(VersionSuffix)</InformationalVersion>
<!-- This is used for error checking to ensure generated code and baselines are up to date when we increment the patch. -->
<PreviousExtensionsReleaseVersion Condition=" '$(PatchVersion)' != '0' ">$(MajorVersion).$(MinorVersion).$([MSBuild]::Subtract($(PatchVersion), 1))</PreviousExtensionsReleaseVersion>
</PropertyGroup>
<!-- Run 'dotnet msbuild version.props' to test changes to this file. -->
<Target Name="InspectVersionNumbers">
<Message Importance="High" Text="InformationalVersion = '$(InformationalVersion)'" />
<Message Importance="High" Text="PackageVersion = '$(PackageVersion)'" />
</Target>
</Project>