Skip to content

Commit eed71b9

Browse files
authored
Support override of PackageOverrides.txt content in servicing (#26308)
* Support override of PackageOverrides.txt content in servicing - doing now ensures we don't forget if we need to service targeting packs - not needed in release/3.1 because that branch still pins packages at `X.Y.0` in targeting packs - did not do bfc1ec6 / #25851 work in 3.1 because dotnet/runtime ref/ assemblies change there - revert no-longer-necessary parts of 6418c8f / #25986 - `$(MicrosoftNETCoreAppRuntimeVersion)` is now correct whenever `GeneratePackageOverrides` runs nits: - rename `GeneratePackageConflictManifest` target to `GeneratePackageOverrides` - rename `$(PackageConflictManifestFileName)` to `$(PackageOverridesFileName)`
1 parent 2e7b294 commit eed71b9

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
3535
<!-- This project should not be referenced via the `<Reference>` implementation. -->
3636
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
3737

38-
<PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
39-
4038
<!--
4139
We are ignoring MSB3243 warnings since implementation and reference assemblies are versioned differently.
4240
We need both to compose the targeting pack with reference assemblies and xml docs.
@@ -52,7 +50,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
5250
<!-- Runtime extensions transport paths -->
5351
<RuntimeExtensionsReferenceDirectory>$(PkgMicrosoft_Extensions_Internal_Transport)\ref\$(TargetFramework)\</RuntimeExtensionsReferenceDirectory>
5452

55-
<!-- Platform manifest override metadata. -->
53+
<!-- Package overrides and platform manifest metadata. -->
54+
<PackageOverridesFileName>PackageOverrides.txt</PackageOverridesFileName>
55+
<!-- PackageOverrides.txt is written in GeneratePackageOverrides target unless servicing. -->
56+
<ReferencePackageOverridesPath Condition="'$(IsServicingBuild)' != 'true'">$(TargetDir)$(PackageOverridesFileName)</ReferencePackageOverridesPath>
57+
<ReferencePackageOverridesPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\$(PackageOverridesFileName)</ReferencePackageOverridesPath>
58+
<!-- PlatformManifest.txt is written in App.Runtime's GenerateSharedFxDepsFile target but not used here when servicing. -->
5659
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' != 'true'">$(PlatformManifestOutputPath)</ReferencePlatformManifestPath>
5760
<ReferencePlatformManifestPath Condition="'$(IsServicingBuild)' == 'true'">$(RepoRoot)eng\PlatformManifest.txt</ReferencePlatformManifestPath>
5861
</PropertyGroup>
@@ -84,7 +87,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
8487
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false'">
8588
$(BuildDependsOn);
8689
_ResolveTargetingPackContent;
87-
GeneratePackageConflictManifest;
90+
GeneratePackageOverrides;
8891
IncludeFrameworkListFile;
8992
_BatchCopyToLayoutTargetDir;
9093
_InstallTargetingPackIntoLocalDotNet;
@@ -144,26 +147,22 @@ This package is an internal implementation of the .NET Core SDK and is not meant
144147
Condition="Exists('%(RootDir)%(Directory)%(FileName).xml')" />
145148
<AspNetCoreReferenceDocXml Include="@(_SelectedExtensionsRefAssemblies->'$(RuntimeExtensionsReferenceDirectory)%(FileName).xml')" />
146149
<!-- Grab remaining .xml files from packages -->
147-
<AspNetCoreReferenceDocXml
148-
Include="@(AspNetCoreReferenceAssemblyPath->WithMetadataValue('ExternallyResolved', 'true')->'%(RootDir)%(Directory)%(Filename).xml')"
150+
<AspNetCoreReferenceDocXml
151+
Include="@(AspNetCoreReferenceAssemblyPath->WithMetadataValue('ExternallyResolved', 'true')->'%(RootDir)%(Directory)%(Filename).xml')"
149152
Condition="Exists('%(RootDir)%(Directory)%(Filename).xml')" />
150153

151154
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
152155
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
153-
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
156+
<RefPackContent Include="$(ReferencePackageOverridesPath)" PackagePath="$(ManifestsPackagePath)" />
154157
<RefPackContent Include="$(ReferencePlatformManifestPath)" PackagePath="$(ManifestsPackagePath)" />
155158
</ItemGroup>
156159
</Target>
157160

158-
<Target Name="GeneratePackageConflictManifest"
161+
<Target Name="GeneratePackageOverrides"
162+
Condition=" '$(IsServicingBuild)' != 'true' "
159163
DependsOnTargets="_ResolveTargetingPackContent"
160164
Inputs="$(MSBuildAllProjects)"
161-
Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
162-
<PropertyGroup>
163-
<_PinnedNETCoreAppRuntimeVersion>$(MicrosoftNETCoreAppRuntimeVersion)</_PinnedNETCoreAppRuntimeVersion>
164-
<_PinnedNETCoreAppRuntimeVersion
165-
Condition=" '$(IsServicingBuild)' == 'true' ">$(_PinnedNETCoreAppRuntimeVersion.Split('.')[0]).$(_PinnedNETCoreAppRuntimeVersion.Split('.')[1]).0</_PinnedNETCoreAppRuntimeVersion>
166-
</PropertyGroup>
165+
Outputs="$(ReferencePackageOverridesPath">
167166
<ItemGroup>
168167
<!-- Use package version for non-Extensions references. -->
169168
<_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(NuGetPackageId)|%(NuGetPackageVersion)')"
@@ -172,16 +171,16 @@ This package is an internal implementation of the .NET Core SDK and is not meant
172171
'%(AspNetCoreReferenceAssemblyPath.NuGetPackageId)' != 'Microsoft.Extensions.Internal.Transport' AND
173172
'%(AspNetCoreReferenceAssemblyPath.NuGetSourceType)' == 'Package' " />
174173

175-
<!-- Use pinned NETCore.App version for Extensions references. -->
176-
<_AspNetCoreAppPackageOverrides Include="@(_SelectedExtensionsRefAssemblies->'%(FileName)|$(_PinnedNETCoreAppRuntimeVersion)')" />
174+
<!-- Use NETCore.App.Runtime version for Extensions references. -->
175+
<_AspNetCoreAppPackageOverrides Include="@(_SelectedExtensionsRefAssemblies->'%(FileName)|$(MicrosoftNETCoreAppRuntimeVersion)')" />
177176

178177
<_AspNetCoreAppPackageOverrides Include="@(AspNetCoreReferenceAssemblyPath->'%(FileName)|$(ReferencePackSharedFxVersion)')"
179178
Condition=" '%(AspNetCoreReferenceAssemblyPath.ReferenceSourceTarget)' == 'ProjectReference' " />
180179
</ItemGroup>
181180

182181
<WriteLinesToFile
183182
Lines="@(_AspNetCoreAppPackageOverrides)"
184-
File="$(TargetDir)$(PackageConflictManifestFileName)"
183+
File="$(ReferencePackageOverridesPath)"
185184
Overwrite="true" />
186185
</Target>
187186

0 commit comments

Comments
 (0)