Skip to content

Commit d854235

Browse files
committed
Generalise how package version isn't stabilized for dev/preview stages
Follow up on #5632
1 parent 698296d commit d854235

File tree

18 files changed

+33
-74
lines changed

18 files changed

+33
-74
lines changed

eng/MSBuild/ProjectStaging.targets

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
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>
11+
</PropertyGroup>
12+
13+
<PropertyGroup>
14+
<!--
15+
Makes it such that the package version won't be stabilized even when the rest of the repo is going stable.
16+
https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Versioning.md#package-version
17+
-->
18+
<SuppressFinalPackageVersion />
19+
<SuppressFinalPackageVersion Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">true</SuppressFinalPackageVersion>
720
</PropertyGroup>
821

922
<!-- Produce errors if we don't have all the right properties defined -->
@@ -22,10 +35,11 @@
2235
<Error Condition="'$(MinMutationScore)' != 'n/a' AND ('$(MinMutationScore)' &lt; 50)" Text="MinMutationScore property must be >= 50 for normal stage." />
2336
</Target>
2437

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>
38+
<Target Name="_ValidateVersion" AfterTargets="GenerateNuspec" Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">
39+
<PropertyGroup>
40+
<_ExpectedVersionSuffix>$(_PreReleaseLabel)$(_BuildNumberLabels)</_ExpectedVersionSuffix>
41+
</PropertyGroup>
3042

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

src/Generators/Microsoft.Gen.MetricsReports/Directory.Build.props

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Generators/Microsoft.Gen.MetricsReports/Microsoft.Gen.MetricsReports.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</PropertyGroup>
1313

1414
<PropertyGroup>
15+
<Stage>dev</Stage>
1516
<MinCodeCoverage>67</MinCodeCoverage>
1617
<MinMutationScore>85</MinMutationScore>
1718
</PropertyGroup>

src/Libraries/Microsoft.AspNetCore.Testing/Directory.Build.props

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Libraries/Microsoft.AspNetCore.Testing/Microsoft.AspNetCore.Testing.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
</PropertyGroup>
1313

1414
<PropertyGroup>
15+
<Stage>dev</Stage>
16+
<StageDevDiagnosticId>EXTEXP0014</StageDevDiagnosticId>
1517
<MinCodeCoverage>100</MinCodeCoverage>
1618
<MinMutationScore>100</MinMutationScore>
1719
</PropertyGroup>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Microsoft.Extensions.AI.Abstractions.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
@@ -8,7 +8,6 @@
88

99
<PropertyGroup>
1010
<Stage>preview</Stage>
11-
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
1211
<EnablePackageValidation>false</EnablePackageValidation>
1312
<MinCodeCoverage>83</MinCodeCoverage>
1413
<MinMutationScore>0</MinMutationScore>

src/Libraries/Microsoft.Extensions.AI.AzureAIInference/Microsoft.Extensions.AI.AzureAIInference.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
@@ -8,7 +8,6 @@
88

99
<PropertyGroup>
1010
<Stage>preview</Stage>
11-
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
1211
<EnablePackageValidation>false</EnablePackageValidation>
1312
<MinCodeCoverage>91</MinCodeCoverage>
1413
<MinMutationScore>0</MinMutationScore>

src/Libraries/Microsoft.Extensions.AI.Ollama/Microsoft.Extensions.AI.Ollama.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
@@ -8,7 +8,6 @@
88

99
<PropertyGroup>
1010
<Stage>preview</Stage>
11-
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
1211
<EnablePackageValidation>false</EnablePackageValidation>
1312
<MinCodeCoverage>80</MinCodeCoverage>
1413
<MinMutationScore>0</MinMutationScore>

src/Libraries/Microsoft.Extensions.AI.OpenAI/Microsoft.Extensions.AI.OpenAI.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
@@ -8,7 +8,6 @@
88

99
<PropertyGroup>
1010
<Stage>preview</Stage>
11-
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
1211
<EnablePackageValidation>false</EnablePackageValidation>
1312
<MinCodeCoverage>77</MinCodeCoverage>
1413
<MinMutationScore>0</MinMutationScore>

src/Libraries/Microsoft.Extensions.AI/Microsoft.Extensions.AI.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<RootNamespace>Microsoft.Extensions.AI</RootNamespace>
@@ -10,7 +10,6 @@
1010

1111
<PropertyGroup>
1212
<Stage>preview</Stage>
13-
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
1413
<EnablePackageValidation>false</EnablePackageValidation>
1514
<MinCodeCoverage>88</MinCodeCoverage>
1615
<MinMutationScore>0</MinMutationScore>

0 commit comments

Comments
 (0)