Skip to content

Commit 118e97e

Browse files
committed
fixup! Generalise how package version isn't stabilized for dev/preview stages
1 parent 440ce4d commit 118e97e

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

eng/MSBuild/ProjectStaging.targets

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<!-- Preview packages: do not use stable branding and do not warn about lack of [Experimental] -->
55
<SuppressFinalPackageVersion Condition="'$(Stage)' == 'preview'">true</SuppressFinalPackageVersion>
66
<NoWarn Condition="'$(Stage)' == 'preview'">$(NoWarn);LA0003</NoWarn>
7+
8+
<!-- Amend the description based on stage -->
9+
<Description Condition="'$(Stage)' == 'dev'">Experimental package. $(Description)</Description>
10+
<Description Condition="'$(Stage)' == 'obsolete'">Obsolete Package. $(Description)</Description>
711
</PropertyGroup>
812

913
<!-- Produce errors if we don't have all the right properties defined -->
@@ -22,19 +26,11 @@
2226
<Error Condition="'$(MinMutationScore)' != 'n/a' AND ('$(MinMutationScore)' &lt; 50)" Text="MinMutationScore property must be >= 50 for normal stage." />
2327
</Target>
2428

25-
<!-- Amend the description based on stage -->
26-
<PropertyGroup>
27-
<Description Condition="'$(Stage)' == 'dev'">Experimental package. $(Description)</Description>
28-
<Description Condition="'$(Stage)' == 'obsolete'">Obsolete Package. $(Description)</Description>
29-
</PropertyGroup>
30-
31-
<PropertyGroup>
32-
<!--
33-
Makes it such that the package version won't be stabilized even when the rest of the repo is going stable.
34-
https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Versioning.md#package-version
35-
-->
36-
<SuppressFinalPackageVersion />
37-
<SuppressFinalPackageVersion Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">true</SuppressFinalPackageVersion>
38-
</PropertyGroup>
29+
<Target Name="_ValidateVersion" AfterTargets="GenerateNuspec" Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">
30+
<PropertyGroup>
31+
<_ExpectedVersionSuffix>$(_PreReleaseLabel)$(_BuildNumberLabels)</_ExpectedVersionSuffix>
32+
</PropertyGroup>
3933

34+
<Error Condition=" '$(VersionSuffix)' != '$(_ExpectedVersionSuffix)' " Text="Unexpected package version suffix. Expected suffix for '$(Stage)' stage: '$(_ExpectedVersionSuffix)', received: '$(VersionSuffix)'." />
35+
</Target>
4036
</Project>

eng/Versions.props

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@
88
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
99
<ValidateBaseline>true</ValidateBaseline>
1010
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
11-
<!--
12-
When DotNetFinalVersionKind is set to 'release', this branch will produce stable outputs for 'Shipping' packages
13-
-->
14-
<DotNetFinalVersionKind />
11+
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>
12+
1513
<!-- Enabling this rule will cause build failures on undocumented public APIs. -->
1614
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591>
1715
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<!--
19+
Makes it such that the package version won't be stabilized even when the rest of the repo is going stable.
20+
https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Versioning.md#package-version
21+
-->
22+
<SuppressFinalPackageVersion />
23+
<SuppressFinalPackageVersion Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">true</SuppressFinalPackageVersion>
24+
</PropertyGroup>
25+
1826
<!--
1927
2028
These versions should ONLY be updated by automation.

0 commit comments

Comments
 (0)