-
Notifications
You must be signed in to change notification settings - Fork 388
/
Copy pathVersion.props
91 lines (82 loc) · 5.88 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<Project>
<PropertyGroup Label="Version settings">
<!--
Use the following values for the different release types:
- "-preview" - Code quality stable, can introduce breaking changes
- "-rc" - Code quality production ready, only minor changes are expected
- "-rtm" - Code quality production ready, major release
- "-servicing" - Code quality production ready, mainly bugfixes
We also used alpha/beta/silver release types in the past, but they mix poorly with the ones above when orderend according to SemVer2
rules.
-->
<VersionPrefix>9.0.0</VersionPrefix>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
<PreReleaseVersionIteration>3</PreReleaseVersionIteration>
<!--
A string like `.efcore.9.0.0` or `.efcore.9.0.0.preview.1` can be added to the version suffix, to indicate that this release targets
a specific EF Core release.
This can be useful to distinguish between a release that correlates with a EF Core release (e.g. Pomelo `9.0.0-preview.1` implicitly
targets EF Core `9.0.0-preview.1`) and one that doesn't (e.g. Pomelo `9.0.0-preview.2.efcore.9.0.0.preview.1` explicitly targets EF
Core `9.0.0-preview.1`).
If no EF Core release is explicitly targeted, release version correlation should be assumed.
-->
<TargetedEfCoreVersionPrefix>9.0.0</TargetedEfCoreVersionPrefix> <!-- e.g. `` (empty) or `9.0.0` -->
<TargetedEfCoreVersionPreReleaseLabel></TargetedEfCoreVersionPreReleaseLabel> <!-- e.g. `` (empty) or `preview` -->
<TargetedEfCoreVersionPreReleaseIteration></TargetedEfCoreVersionPreReleaseIteration> <!-- e.g. `` (empty) or `1` -->
<!--
The following properties will automatically be set by CI builds when appropriate:
OfficialVersion: Mainly used to ensure that the git release tag and the version specified in this file are identical.
ContinuousIntegrationTimestamp
BuildSha
-->
</PropertyGroup>
<!--
The following are all valid version formats:
9.0.0
9.0.0.ci.20201004T181121Z
9.0.0.ci.20201004T181121Z+sha.0a1b2c3
9.0.0.ci.20201004T181121Z.debug
9.0.0.ci.20201004T181121Z.debug+sha.0a1b2c3
9.0.0-preview.2
9.0.0-preview.2.ci.20201004T181121Z
9.0.0-preview.2.ci.20201004T181121Z+sha.0a1b2c3
9.0.0-preview.2.ci.20201004T181121Z.debug
9.0.0-preview.2.ci.20201004T181121Z.debug+sha.0a1b2c3
9.0.0-preview.2.efcore.9.0.0.ci.20201004T181121Z
9.0.0-preview.2.efcore.9.0.0.ci.20201004T181121Z+sha.0a1b2c3
9.0.0-preview.2.efcore.9.0.0.ci.20201004T181121Z.debug
9.0.0-preview.2.efcore.9.0.0.ci.20201004T181121Z.debug+sha.0a1b2c3
9.0.0-preview.2.efcore.9.0.0.preview.1.ci.20201004T181121Z
9.0.0-preview.2.efcore.9.0.0.preview.1.ci.20201004T181121Z+sha.0a1b2c3
9.0.0-preview.2.efcore.9.0.0.preview.1.ci.20201004T181121Z.debug
9.0.0-preview.2.efcore.9.0.0.preview.1.ci.20201004T181121Z.debug+sha.0a1b2c3
-->
<PropertyGroup Label="Targeted EF Core Version Handling" Condition="'$(TargetedEfCoreVersionPrefix)' != ''">
<TargetedEfCoreVersion>.efcore.$(TargetedEfCoreVersionPrefix)</TargetedEfCoreVersion>
<TargetedEfCoreVersion Condition="'$(TargetedEfCoreVersionPreReleaseLabel)' != ''">$(TargetedEfCoreVersion).$(TargetedEfCoreVersionPreReleaseLabel)</TargetedEfCoreVersion>
<TargetedEfCoreVersion Condition="'$(TargetedEfCoreVersionPreReleaseLabel)' != '' And '$(TargetedEfCoreVersionPreReleaseIteration)'">$(TargetedEfCoreVersion).$(TargetedEfCoreVersionPreReleaseIteration)</TargetedEfCoreVersion>
</PropertyGroup>
<PropertyGroup Label="Version Suffix Handling" Condition="'$(Version)' == '' And '$(VersionSuffix)' == ''">
<VersionSuffix Condition="'$(OfficialVersion)' == '' Or $(OfficialVersion.Contains('-'))">$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)$(TargetedEfCoreVersion)</VersionSuffix>
<VersionSuffix Condition="'$(OfficialVersion)' == '' And '$(ContinuousIntegrationTimestamp)' != ''">$(VersionSuffix).ci.$(ContinuousIntegrationTimestamp)</VersionSuffix>
<VersionSuffix Condition="'$(Configuration)' == 'Debug'">$(VersionSuffix).debug</VersionSuffix>
<VersionSuffix Condition="'$(BuildSha)' != ''">$(VersionSuffix)+sha.$(BuildSha)</VersionSuffix>
<VersionSuffix>$(VersionSuffix.TrimStart(`.`))</VersionSuffix>
</PropertyGroup>
<Target Name="OutputVersionProperties" BeforeTargets="CoreBuild" Condition="'$(OutputVersionProperties)' == 'true'">
<Message Importance="high" Text="OfficialVersion: $(OfficialVersion)" />
<Message Importance="high" Text="Version: $(Version)" />
<Message Importance="high" Text="VersionPrefix: $(VersionPrefix)" />
<Message Importance="high" Text="VersionSuffix: $(VersionSuffix)" />
</Target>
<Target Name="EnsureVersionProperties" BeforeTargets="CoreBuild">
<Error Condition="'$(Version)' == '' And '$(VersionPrefix)' == ''" Text="The 'VersionPrefix' property needs to be set." />
<Error Condition="'$(Version)' == '' And '$(VersionSuffix)' == '' And '$(PreReleaseVersionLabel)' == ''" Text="The 'PreReleaseVersionLabel' property needs to be set." />
<Error Condition="'$(Version)' == '' And '$(VersionSuffix)' == '' And '$(PreReleaseVersionIteration)' == ''" Text="The 'PreReleaseVersionIteration' property needs to be set." />
<Error Condition="'$(OfficialVersion)' != '' And '$(OfficialVersion)' != '$(Version)' And '$(OfficialVersion)-' != '$(VersionPrefix)-$(VersionSuffix)' And '$(OfficialVersion)' != '$(VersionPrefix)-$(VersionSuffix)'" Text="The 'OfficialVersion' property needs to be identical to the 'Version' property, 'VersionPrefix' property (if the 'VersionSuffix' property is empty) or to a combination of the 'VersionPrefix' and 'VersionSuffix' properties." />
</Target>
<!-- TODO: Take a look at this. -->
<PropertyGroup>
<IncludeSourceRevisionInInformationalVersion>False</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
</Project>