Skip to content

Commit aee5e40

Browse files
dougbummitche
authored andcommitted
Stabilize package versions (#14003)
* Mark all blobs as shipping - available (though not discoverable) in public dotnetcli feed * Stabilize package versions * Remove assumption that Microsoft.AspNetCore.AzureAppServices.SiteExtension packages have same version - Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0 ships - Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0.x?? do not ship * Make installer versions consistent - VS.Redist.Common.AspNetCore.SharedFramework and ...TargetingPack packages are non-shipping - everything else ships nit: remove extra whitespace in .nuspec files for the packages * Correct assumptions in framework unit tests - tests sometimes do not calculate version properties as product projects do - Microsoft.AspNetCore.App.Ref and ...Runtime packages may rev versions separately * Fix last 2 `SharedFxTests` failures * Correct Microsoft.AspNetCore.App* versions used in ProjectTemplates tests - `$(SharedFxVersion)` is not useful in test projects due to stable versioning * Add continue on error for test templates
1 parent adc28fd commit aee5e40

File tree

14 files changed

+107
-29
lines changed

14 files changed

+107
-29
lines changed

.azure/pipelines/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ stages:
446446
displayName: Pack Templates
447447
- script: ./src/ProjectTemplates/build.cmd -ci -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true /bl:artifacts/log/template.test.binlog"
448448
displayName: Test Templates
449+
continueOnError: true # Continue on error to avoid issues with stabilized build.
449450
artifacts:
450451
- name: Windows_Test_Templates_Logs
451452
path: artifacts/log/

eng/Publishing.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
<ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT'" />
4747

4848
<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)">
49-
<IsShipping>false</IsShipping>
50-
<ManifestArtifactData>NonShipping=true;ShipInstaller=dotnetcli</ManifestArtifactData>
49+
<IsShipping>true</IsShipping>
50+
<ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>
5151
<PublishFlatContainer>true</PublishFlatContainer>
5252
<RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
5353
</ItemsToPushToBlobFeed>

eng/Versions.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
<AspNetCoreMinorVersion>0</AspNetCoreMinorVersion>
1111
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
1212
<PreReleasePreviewNumber>2</PreReleasePreviewNumber>
13+
14+
<!--
15+
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
16+
-->
17+
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">true</StabilizePackageVersion>
18+
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
19+
1320
<IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
1421
<IncludePreReleaseLabelInPackageVersion Condition=" '$(DotNetFinalVersionKind)' == 'release' ">false</IncludePreReleaseLabelInPackageVersion>
1522
<PreReleaseVersionLabel>rc$(PreReleasePreviewNumber)</PreReleaseVersionLabel>

src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
<_Parameter1>SharedFxVersion</_Parameter1>
1616
<_Parameter2>$(SharedFxVersion)</_Parameter2>
1717
</AssemblyAttribute>
18-
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
19-
<_Parameter1>TargetingPackVersion</_Parameter1>
20-
<_Parameter2>$(TargetingPackVersion)</_Parameter2>
21-
</AssemblyAttribute>
2218
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
2319
<_Parameter1>TargetRuntimeIdentifier</_Parameter1>
2420
<_Parameter2>$(TargetRuntimeIdentifier)</_Parameter2>
@@ -57,11 +53,35 @@
5753
</ItemGroup>
5854

5955
<Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="InitializeSourceControlInformation">
56+
<!-- This target is defined in eng/targets/Packaging.targets and included in every C# and F# project. -->
57+
<MSBuild Projects="$(RepoRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj"
58+
Targets="_GetPackageVersionInfo"
59+
SkipNonexistentProjects="false">
60+
<Output TaskParameter="TargetOutputs" ItemName="_RuntimePackageVersionInfo" />
61+
</MSBuild>
62+
63+
<!-- Runtime and Ref packs may have separate versions. -->
64+
<MSBuild Projects="$(RepoRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj"
65+
Targets="_GetPackageVersionInfo"
66+
SkipNonexistentProjects="false">
67+
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackVersionInfo" />
68+
</MSBuild>
69+
6070
<ItemGroup>
6171
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
6272
<_Parameter1>RepositoryCommit</_Parameter1>
6373
<_Parameter2>$(SourceRevisionId)</_Parameter2>
6474
</AssemblyAttribute>
75+
76+
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
77+
<_Parameter1>RuntimePackageVersion</_Parameter1>
78+
<_Parameter2>@(_RuntimePackageVersionInfo->'%(PackageVersion)')</_Parameter2>
79+
</AssemblyAttribute>
80+
81+
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
82+
<_Parameter1>TargetingPackVersion</_Parameter1>
83+
<_Parameter2>@(_TargetingPackVersionInfo->'%(PackageVersion)')</_Parameter2>
84+
</AssemblyAttribute>
6585
</ItemGroup>
6686
</Target>
6787

src/Framework/test/SharedFxTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public SharedFxTests(ITestOutputHelper output)
2323
_output = output;
2424
_expectedTfm = "netcoreapp" + TestData.GetSharedFxVersion().Substring(0, 3);
2525
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
26-
_sharedFxRoot = Path.Combine(TestData.GetTestDataValue("SharedFrameworkLayoutRoot"), "shared", "Microsoft.AspNetCore.App", TestData.GetSharedFxVersion());
26+
_sharedFxRoot = Path.Combine(TestData.GetTestDataValue("SharedFrameworkLayoutRoot"), "shared", "Microsoft.AspNetCore.App", TestData.GetTestDataValue("RuntimePackageVersion"));
2727
}
2828

2929
[Fact]
@@ -77,7 +77,7 @@ public void ItContainsValidDepsJson()
7777

7878
var target = $".NETCoreApp,Version=v{TestData.GetSharedFxVersion().Substring(0, 3)}/{_expectedRid}";
7979
var ridPackageId = $"Microsoft.AspNetCore.App.Runtime.{_expectedRid}";
80-
var libraryId = $"{ridPackageId}/{TestData.GetSharedFxVersion()}";
80+
var libraryId = $"{ridPackageId}/{TestData.GetTestDataValue("RuntimePackageVersion")}";
8181

8282
AssertEx.FileExists(depsFilePath);
8383

@@ -136,7 +136,7 @@ public void ItContainsVersionFile()
136136
var lines = File.ReadAllLines(versionFile);
137137
Assert.Equal(2, lines.Length);
138138
Assert.Equal(TestData.GetRepositoryCommit(), lines[0]);
139-
Assert.Equal(TestData.GetSharedFxVersion(), lines[1]);
139+
Assert.Equal(TestData.GetTestDataValue("RuntimePackageVersion"), lines[1]);
140140
}
141141
}
142142
}

src/Installers/Debian/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
<DebianPackageArch Condition=" '$(TargetArchitecture)' == 'x64' ">amd64</DebianPackageArch>
1313

1414
<DebianBuildScript>$(MSBuildThisFileDirectory)tools/build.sh</DebianBuildScript>
15+
16+
<!-- All installers are shipping assets. -->
17+
<IsShipping>true</IsShipping>
18+
<IsShippingPackage>true</IsShippingPackage>
1519
</PropertyGroup>
1620
</Project>

src/Installers/Rpm/Directory.Build.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
<Project>
55
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
66

7-
<!-- Output paths -->
87
<PropertyGroup>
8+
<!-- Output paths -->
99
<IntermediateOutputPath>$(IntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
1010
<OutputPath>$(InstallersOutputPath)</OutputPath>
11+
12+
<!-- All installers are shipping assets. -->
13+
<IsShipping>true</IsShipping>
14+
<IsShippingPackage>true</IsShippingPackage>
1115
</PropertyGroup>
1216

1317
</Project>

src/Installers/Windows/SharedFramework/SharedFramework.wixproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,21 @@
8585
<PropertyGroup>
8686
<MsiFullPath>$(InstallersOutputPath)$(PackageFileName)</MsiFullPath>
8787
<CabFullPath>$(InstallersOutputPath)$(Cabinet)</CabFullPath>
88+
89+
<!-- Everything built in this project _except_ the final package are shipping assets. -->
90+
<_GeneratedPackageVersion>$(PackageVersion)</_GeneratedPackageVersion>
91+
<_GeneratedPackageVersion
92+
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</_GeneratedPackageVersion>
8893
</PropertyGroup>
89-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
94+
95+
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
9096
'$(ProductNameShort)' ^
9197
'$(MsiFullPath)' ^
9298
'$(CabFullPath)' ^
9399
'$(ToolsetInstallerNuspecFile)' ^
94100
'$(ArtifactsNonShippingPackagesDir)' ^
95101
'$(Platform)' ^
96-
'$(PackageVersion)' ^
102+
'$(_GeneratedPackageVersion)' ^
97103
'$(RepoRoot)' ^
98104
'$(AspNetCoreMajorVersion)' ^
99105
'$(AspNetCoreMinorVersion)'" />

src/Installers/Windows/SharedFramework/SharedFrameworkPackage.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
4-
<id> VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</id>
4+
<id>VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</id>
55
<version>1.0.0</version>
6-
<title> VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</title>
6+
<title>VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</title>
77
<authors>Microsoft</authors>
88
<owners>Microsoft</owners>
99
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>

src/Installers/Windows/TargetingPack/TargetingPack.wixproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,21 @@
8080
<Target Name="CreateTargetingPackNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build">
8181
<PropertyGroup>
8282
<MsiFullPath>$(InstallersOutputPath)$(PackageFileName)</MsiFullPath>
83+
84+
<!-- Everything built in this project _except_ the final package are shipping assets. -->
85+
<_GeneratedPackageVersion>$(PackageVersion)</_GeneratedPackageVersion>
86+
<_GeneratedPackageVersion
87+
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</_GeneratedPackageVersion>
8388
</PropertyGroup>
84-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
89+
90+
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
8591
'$(ProductNameShort)' ^
8692
'$(MsiFullPath)' ^
8793
'$(CabFullPath)' ^
8894
'$(ToolsetInstallerNuspecFile)' ^
8995
'$(ArtifactsNonShippingPackagesDir)' ^
9096
'$(Platform)' ^
91-
'$(PackageVersion)' ^
97+
'$(_GeneratedPackageVersion)' ^
9298
'$(RepoRoot)' ^
9399
'$(AspNetCoreMajorVersion)' ^
94100
'$(AspNetCoreMinorVersion)'" />

src/Installers/Windows/TargetingPack/TargetingPackPackage.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata>
44
<id>VS.Redist.Common.AspNetCore.TargetingPack.$ARCH$.$MAJOR$.$MINOR$</id>
55
<version>1.0.0</version>
6-
<title> VS.Redist.Common.AspNetCore.TargetingPack.$ARCH$.$MAJOR$.$MINOR$</title>
6+
<title>VS.Redist.Common.AspNetCore.TargetingPack.$ARCH$.$MAJOR$.$MINOR$</title>
77
<authors>Microsoft</authors>
88
<owners>Microsoft</owners>
99
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
@@ -15,4 +15,4 @@
1515
<files>
1616
<file src="$ASPNETCORE_RUNTIME_MSI$" />
1717
</files>
18-
</package>
18+
</package>

src/ProjectTemplates/test/Infrastructure/GenerateTestProps.targets

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
<Project>
2-
<Target
3-
Name="GenerateTestProps"
4-
BeforeTargets="CoreCompile"
5-
DependsOnTargets="PrepareForTest"
6-
Condition="$(DesignTimeBuild) != true">
2+
<Target Name="GenerateTestProps"
3+
BeforeTargets="CoreCompile"
4+
DependsOnTargets="PrepareForTest"
5+
Condition="$(DesignTimeBuild) != true">
6+
<!-- The version of the shared framework. This is used in tests to ensure they run against the shared framework version we just built. -->
7+
<MSBuild Projects="$(RepoRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj"
8+
Targets="_GetPackageVersionInfo"
9+
SkipNonexistentProjects="false">
10+
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackVersionInfo" />
11+
</MSBuild>
12+
13+
<!-- Runtime and Ref packs may have separate versions. -->
14+
<MSBuild Projects="$(RepoRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj"
15+
Targets="_GetPackageVersionInfo"
16+
SkipNonexistentProjects="false">
17+
<Output TaskParameter="TargetOutputs" ItemName="_RuntimePackageVersionInfo" />
18+
</MSBuild>
19+
720
<PropertyGroup>
821
<PropsProperties>
922
RestoreAdditionalProjectSources=$([MSBuild]::Escape("$(RestoreAdditionalProjectSources);$(ArtifactsShippingPackagesDir);$(ArtifactsNonShippingPackagesDir)"));
@@ -12,7 +25,8 @@
1225
MicrosoftNETCoreAppRefPackageVersion=$(MicrosoftNETCoreAppRefPackageVersion);
1326
MicrosoftNETCorePlatformsPackageVersion=$(MicrosoftNETCorePlatformsPackageVersion);
1427
MicrosoftNETSdkRazorPackageVersion=$(MicrosoftNETSdkRazorPackageVersion);
15-
MicrosoftAspNetCoreAppPackageVersion=$(SharedFxVersion);
28+
MicrosoftAspNetCoreAppRefPackageVersion=@(_TargetingPackVersionInfo->'%(PackageVersion)');
29+
MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)');
1630
SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers);
1731
</PropsProperties>
1832
</PropertyGroup>

src/ProjectTemplates/test/Infrastructure/TemplateTests.props.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
<KnownFrameworkReference
2020
Update="Microsoft.AspNetCore.App"
21-
DefaultRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppPackageVersion}"
22-
LatestRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppPackageVersion}"
23-
TargetingPackVersion="${MicrosoftAspNetCoreAppPackageVersion}"
21+
DefaultRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppRuntimePackageVersion}"
22+
LatestRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppRuntimePackageVersion}"
23+
TargetingPackVersion="${MicrosoftAspNetCoreAppRefPackageVersion}"
2424
RuntimePackRuntimeIdentifiers="${SupportedRuntimeIdentifiers}" />
2525
</ItemGroup>
2626

src/SiteExtensions/LoggingAggregate/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension/Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
<ItemGroup>
2525
<Reference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.2.1" Version="$(MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion)" PrivateAssets="All" />
2626
<Reference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.2.2" Version="$(MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion)" PrivateAssets="All" />
27-
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0.x86" Version="$(PackageVersion)" PrivateAssets="All" />
28-
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0.x64" Version="$(PackageVersion)" PrivateAssets="All" />
2927
</ItemGroup>
3028

3129
<ItemGroup>
@@ -39,7 +37,25 @@
3937
</ItemGroup>
4038

4139
<Target Name="AddContent" BeforeTargets="_GetPackageFiles">
40+
<!-- Cannot assume this project and LB.csproj have the same package version. -->
41+
<!-- This target is defined in eng/targets/Packaging.targets and included in every C# and F# project. -->
42+
<MSBuild Projects="$(RepoRoot)src\SiteExtensions\LoggingBranch\LB.csproj"
43+
Targets="_GetPackageVersionInfo"
44+
SkipNonexistentProjects="false">
45+
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedPackageVersionInfo" />
46+
</MSBuild>
47+
48+
<ItemGroup>
49+
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0.x86"
50+
Version="%(_ResolvedPackageVersionInfo.PackageVersion)"
51+
PrivateAssets="All" />
52+
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.3.0.x64"
53+
Version="%(_ResolvedPackageVersionInfo.PackageVersion)"
54+
PrivateAssets="All" />
55+
</ItemGroup>
56+
4257
<ItemGroup>
58+
<!-- LB.csproj package content is bundled into this one. -->
4359
<ContentFilesToPack Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\content\**\*.*" />
4460

4561
<!-- Temporarily skip the common files -->

0 commit comments

Comments
 (0)