-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathVersion.props
More file actions
55 lines (45 loc) · 2.89 KB
/
Version.props
File metadata and controls
55 lines (45 loc) · 2.89 KB
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
<Project>
<!--
Import the first 'Directory.Version.props' seen from project being built up.
This allows each directory cone to set its own versioning at the time this file needs it set.
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Directory.Version.props))/Directory.Version.props"
Condition="'$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Directory.Version.props))' != ''" />
<PropertyGroup>
<CI>false</CI>
<CI Condition="'$(TF_BUILD)' == 'true'">true</CI>
<ContinuousIntegrationBuild>$(CI)</ContinuousIntegrationBuild>
<TreatWarningsAsErrors Condition="'$(CI)' == 'true'">true</TreatWarningsAsErrors>
<BuildReason>dev</BuildReason>
<BuildReason Condition="'$(BUILD_REASON)' != ''">ci</BuildReason>
<BuildReason Condition="'$(BUILD_REASON)' == 'PullRequest'">pr</BuildReason>
<!-- Only set public release if this is a release tag or a release branch -->
<!-- tag must be either 'v{Version}' or {name}-v{Version} for a match -->
<!-- release branch must be refs/heads/release/* -->
<PublicReleaseTag Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(BUILD_SOURCEBRANCH), `refs/tags/(?:.*-)?v.*`))">$(BUILD_SOURCEBRANCHNAME)</PublicReleaseTag>
<PublicRelease>false</PublicRelease>
<PublicRelease Condition="'$(PublicReleaseTag)' != ''">true</PublicRelease>
<PublicRelease Condition="'$(BUILD_SOURCEBRANCH)' != '' AND $(BUILD_SOURCEBRANCH.StartsWith('refs/heads/release/'))">true</PublicRelease>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix Condition="'$(VersionPrefix)' == ''">1.0.0</VersionPrefix>
<_BuildNumber>$([System.DateTime]::Now.ToString(yyyyMMdd))</_BuildNumber>
<_BuildNumberYY>$(_BuildNumber.Substring(2, 2))</_BuildNumberYY>
<_BuildNumberMM>$(_BuildNumber.Substring(4, 2))</_BuildNumberMM>
<_BuildNumberDD>$(_BuildNumber.Substring(6, 2))</_BuildNumberDD>
<!-- The build number should be < 65,535 (Windows limitation). We convert into a short date to accommodate that. -->
<!-- SHORT_DATE := yy * 1000 + MM * 50 + dd -->
<BuildNumber>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</BuildNumber>
<BuildCounter Condition="'$(BUILD_COUNTER)' != ''">$(BUILD_COUNTER)</BuildCounter>
<BuildCounter Condition="'$(BuildCounter)' == ''">0</BuildCounter>
<!-- Major.Minor.Patch -> Major.Minor.0.0 -->
<AssemblyVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.')))).0.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' != 'true'">
<!-- Constant file version for local dev. -->
<FileVersion>42.42.42.4242</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' == 'true'">
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>
</Project>