Skip to content

[release/3.0] Stabilize package versions #14933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@
<RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName>
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>

<!-- 3.0.1 is a special servicing release since we're building the targeting pack. We need this condition in a few places. -->
<IsTargetingPackPatching Condition="'$(VersionPrefix)' == '3.0.1'">true</IsTargetingPackPatching>

<!-- Used to only produce targeting pack installers/packages once per major.minor. -->
<IsTargetingPackBuilding Condition="'$(AspNetCorePatchVersion)' != '0' OR '$(DotNetBuildFromSource)' == 'true'">false</IsTargetingPackBuilding>

<!-- We need to build the targeting pack in 3.0.1. We can remove this line from any branch other than release/3.0 -->
<IsTargetingPackBuilding Condition="'$(VersionPrefix)' == '3.0.1' AND '$(DotNetBuildFromSource)' != 'true'">true</IsTargetingPackBuilding>
<IsTargetingPackBuilding Condition="'$(IsTargetingPackPatching)' == 'true' AND '$(DotNetBuildFromSource)' != 'true'">true</IsTargetingPackBuilding>

<!--
Archives and installers using this prefix are intended for internal-use only.
Expand Down
12 changes: 11 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@

<PropertyGroup
Condition=" '$(IsPackable)' != 'false' AND '$(AspNetCorePatchVersion)' != '0' AND '$(DisableServicingFeatures)' != 'true' ">
<IsPackageInThisPatch Condition="'$(IsPackageInThisPatch)' == ''">$(PackagesInPatch.Contains(' $(PackageId);'))</IsPackageInThisPatch>
<!-- Remove RID to ensure PackagesInPatch only needs to specify the RID-less package name -->
<PackageIdWithoutRID>$(PackageId)</PackageIdWithoutRID>
<PackageIdWithoutRID Condition="'$(RuntimeIdentifier)' != ''">$(PackageId.Replace('.$(RuntimeIdentifier)',''))</PackageIdWithoutRID>
<IsPackageInThisPatch Condition="'$(IsPackageInThisPatch)' == ''">$(PackagesInPatch.Contains(' $(PackageIdWithoutRID);'))</IsPackageInThisPatch>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsPackable)' != 'false' AND '$(IsServicingBuild)' == 'true' ">
Expand All @@ -70,6 +73,10 @@
<IsPackable Condition=" '$(IsPackageInThisPatch)' != 'true' ">false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<PackageVersionForPackageVersionInfo>$(PackageVersion)</PackageVersionForPackageVersionInfo>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsPackageInThisPatch)' != 'true' AND '$(BaselinePackageVersion)' != '' AND '$(IsServicingBuild)' == 'true' ">
<!-- This keeps assembly and package versions consistent across patches. If a package is not included in a patch, its version should stay at the baseline. -->
<AssemblyVersion Condition="$(BaselinePackageVersion.Contains('-'))">$(BaselinePackageVersion.Substring(0, $(BaselinePackageVersion.IndexOf('-')))).0</AssemblyVersion>
Expand All @@ -83,6 +90,9 @@
-->
<Version Condition="'$(NoBuild)' == 'true' AND '$(DesignTimeBuild)' == 'true'">$(BaselinePackageVersion)</Version>
<PackageVersion Condition="'$(NoBuild)' == 'true' AND '$(DesignTimeBuild)' == 'true'">$(BaselinePackageVersion)</PackageVersion>

<!-- For servicing builds, we want to resolve basline versions of project packages that aren't building, always -->
<PackageVersionForPackageVersionInfo>$(BaselinePackageVersion)</PackageVersionForPackageVersionInfo>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.Extensions.WebEncoders" Version="$(MicrosoftExtensionsWebEncodersPackageVersion)" />
<LatestPackageReference Include="Microsoft.JSInterop" Version="$(MicrosoftJSInteropPackageVersion)" />
<LatestPackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryPackageVersion)" />
<LatestPackageReference Include="Microsoft.Win32.SystemEvents" Version="$(MicrosoftWin32SystemEventsPackageVersion)" />
<LatestPackageReference Include="System.Buffers" Version="$(SystemBuffersPackageVersion)" />
<LatestPackageReference Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
<LatestPackageReference Include="System.CommandLine.Experimental" Version="$(SystemCommandlineExperimentalPackageVersion)" />
<LatestPackageReference Include="System.ComponentModel" Version="$(SystemComponentModelPackageVersion)" />
<LatestPackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
<LatestPackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" />
<LatestPackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
<LatestPackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" />
<LatestPackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
<LatestPackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataPackageVersion)" />
Expand All @@ -99,6 +101,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsPackageVersion)" />
<LatestPackageReference Include="System.Text.Json" Version="$(SystemTextJsonPackageVersion)" />
<LatestPackageReference Include="System.Threading.Channels" Version="$(SystemThreadingChannelsPackageVersion)" />
<LatestPackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" />

<!-- Runtime packages required for crossgen -->
<LatestPackageReference Include="microsoft.netcore.app.runtime.win-x64" Version="$(MicrosoftNETCoreAppRuntimeVersion)" />
Expand Down
11 changes: 11 additions & 0 deletions eng/PatchConfig.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ This file contains a list of the package IDs which are patching in a given relea
CAUTION: due to limitations in MSBuild, the format of the PackagesInPatch property is picky.
When adding a new package, make sure the new line ends with a semicolon and starts with a space.

NOTE: Package IDs may be different from the project name. For example Microsoft.DotNet.Web.ProjectTemplates.csproj
Produces Microsoft.DotNet.Web.ProjectTemplates.$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion) package. Also,
for the sake of simplicity, Microsoft.AspNetCore.App.Runtime.{RID} package IDs will be resolved as
Microsoft.AspNetCore.App.Runtime in this file; you do not need to append the RIDs when addint it to this file.

Directory.Build.props checks this property using the following condition:
<IsPackageInThisPatch>$(PackagesInPatch.Contains(' $(PackageId);'))</IsPackageInThisPatch>
-->
Expand All @@ -23,6 +28,12 @@ Directory.Build.props checks this property using the following condition:
Microsoft.AspNetCore.Http.Abstractions;
Microsoft.AspNetCore.Http.Features;
Microsoft.AspNetCore.CookiePolicy;
Microsoft.AspNetCore.App.Ref;
Microsoft.AspNetCore.App.Runtime;
Microsoft.DotNet.Web.Client.ItemTemplates;
Microsoft.DotNet.Web.ItemTemplates;
Microsoft.DotNet.Web.ProjectTemplates.3.0;
Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0;
</PackagesInPatch>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
-->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">true</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
<IncludePreReleaseLabelInPackageVersion>true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition=" '$(DotNetFinalVersionKind)' == 'release' ">false</IncludePreReleaseLabelInPackageVersion>
Expand All @@ -37,7 +37,7 @@
<!-- TargetingPackVersionPrefix is used by projects, like .deb and .rpm, which use slightly different version formats. -->
<TargetingPackVersionPrefix>$(VersionPrefix)</TargetingPackVersionPrefix>
<!-- Targeting packs do not produce patch versions in servicing builds. No API changes are allowed in patches. -->
<TargetingPackVersionPrefix Condition="'$(IsServicingBuild)' == 'true'">$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0</TargetingPackVersionPrefix>
<TargetingPackVersionPrefix Condition="'$(IsServicingBuild)' == 'true'">$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).1</TargetingPackVersionPrefix>
<ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix>
<!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. -->
<AspNetCoreModuleVersionMajor>$([MSBuild]::Add(10, $(AspNetCoreMajorVersion)))</AspNetCoreModuleVersionMajor>
Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)">
<PackageId>$(PackageId)</PackageId>
<PackageVersion>$(PackageVersion)</PackageVersion>
<PackageVersion>$(PackageVersionForPackageVersionInfo)</PackageVersion>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<VersionVariableName>$(PackageId.Replace('.',''))PackageVersion</VersionVariableName>
</_ProjectPathWithVersion>
Expand Down
8 changes: 6 additions & 2 deletions eng/targets/ResolveReferences.targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
* preparing a new major or minor release (i.e. a non-servicing builds)
* when a project is a test or sample project
* when a package is releasing a new patch (we like to update external dependencies in patches when possible)
* the targeting pack is being patched
-->
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsServicingBuild)' != 'true' ">true</UseLatestPackageReferences>
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsTargetingPackPatching)' == 'true' ">true</UseLatestPackageReferences>
<UseLatestPackageReferences Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsImplementationProject)' != 'true' ">true</UseLatestPackageReferences>
<UseLatestPackageReferences
Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsImplementationProject)' == 'true' AND '$(IsPackable)' == 'true' ">true</UseLatestPackageReferences>
Expand All @@ -44,9 +46,11 @@
Projects should only use the project references instead of baseline package references when:
* preparing a new major or minor release (i.e. a non-servicing builds)
* when a project is a test or sample project
* the targeting pack is being patched
We don't use project references between components in servicing builds between compontents to preserve the baseline as much as possible.
-->
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' AND '$(IsServicingBuild)' != 'true' ">true</UseProjectReferences>
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' AND '$(IsTargetingPackPatching)' == 'true' ">true</UseProjectReferences>
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' AND '$(IsImplementationProject)' != 'true' ">true</UseProjectReferences>
<UseProjectReferences Condition=" '$(UseProjectReferences)' == '' ">false</UseProjectReferences>

Expand Down Expand Up @@ -142,8 +146,8 @@

<!-- Identify if any references were present in the last release of this package, but have been removed. -->
<UnusedBaselinePackageReference Include="@(BaselinePackageReference)" Exclude="@(Reference);@(_ProjectReferenceByAssemblyName);@(PackageReference)" />
<!-- Only allow suppressing baseline changes in non-servicing builds. -->
<UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)" Condition="'$(IsServicingBuild)' != 'true'"/>
<!-- Only allow suppressing baseline changes in non-servicing builds, or if the targeting pack is being patched. -->
<UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)" Condition="'$(IsServicingBuild)' != 'true' OR '$(IsTargetingPackPatching)' == 'true' "/>

<!--
MSBuild does not provide a way to join on matching identities in a Condition,
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Target Name="_CreateTargetingPackArchive"
Inputs="@(RefPackContent)"
Outputs="$(ZipArchiveOutputPath);$(TarArchiveOutputPath)"
Condition="'$(IsPackable)' == 'true'">
Condition="'$(IsPackable)' == 'true' OR '$(IsTargetingPackPatching)' == 'true' ">
<PropertyGroup>
<_TarCommand>tar</_TarCommand>
<_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe</_TarCommand>
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- Always generated, even though output type == Library -->
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<ProjectRuntimeConfigFileName>$(SharedFxName).runtimeconfig.json</ProjectRuntimeConfigFileName>
<!-- Target the latest runtime patch so the latest version is specified in runtimeconfig.json -->
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>

<!-- Suppress .deps generation (we have to customize its layout. -->
<GenerateDependencyFile>false</GenerateDependencyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=netcoreapp3.0" />
<TestAssetPublishProfile Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
<TestAssetPublishProfile Condition="'$(TargetArchitecture)' != 'arm'" Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=netcoreapp3.0" />
<TestAssetPublishProfile Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
<TestAssetPublishProfile Condition="'$(TargetArchitecture)' != 'arm'" Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
</ItemGroup>

<ItemGroup>
Expand Down