Add package override manifest to the targeting pack (#7555)

This commit is contained in:
Nate McMaster 2019-02-13 19:32:47 -08:00 committed by GitHub
parent f2a1a4542e
commit 94109e6655
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -35,6 +35,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- This project should not be referenced via the `<Reference>` impementation. --> <!-- This project should not be referenced via the `<Reference>` impementation. -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider> <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<PackageConflictManifestFileName>PackageOverrides.txt</PackageConflictManifestFileName>
<PackageConflictManifestPackagePath>data/</PackageConflictManifestPackagePath>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -47,6 +50,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<PropertyGroup> <PropertyGroup>
<BuildDependsOn> <BuildDependsOn>
$(BuildDependsOn); $(BuildDependsOn);
GeneratePackageConflictManifest;
_ResolveTargetingPackContent; _ResolveTargetingPackContent;
_BatchCopyToOutputDirectory; _BatchCopyToOutputDirectory;
</BuildDependsOn> </BuildDependsOn>
@ -83,9 +87,25 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" /> <RefPackContent Include="@(AspNetCoreReferenceDocXml)" />
<_PackageFiles Include="@(RefPackContent)" PackagePath="$(RefAssemblyPackagePath)" /> <_PackageFiles Include="@(RefPackContent)" PackagePath="$(RefAssemblyPackagePath)" />
<_PackageFiles Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="GeneratePackageConflictManifest"
DependsOnTargets="ResolveReferences"
Inputs="$(MSBuildAllProjects)"
Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
<ItemGroup>
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(NuGetPackageId)|%(NuGetPackageVersion)')" Condition=" '%(ReferencePath.NuGetPackageId)' != 'Microsoft.NETCore.App' AND '%(ReferencePath.NuGetSourceType)' == 'Package' " />
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(SharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' " />
</ItemGroup>
<WriteLinesToFile
Lines="@(_AspNetCoreAppPackageOverrides)"
File="$(TargetDir)$(PackageConflictManifestFileName)"
Overwrite="true" />
</Target>
<!-- Written to take advantage of target batching in MSBuild. --> <!-- Written to take advantage of target batching in MSBuild. -->
<Target Name="_BatchCopyToOutputDirectory" <Target Name="_BatchCopyToOutputDirectory"
DependsOnTargets="_ResolveTargetingPackContent" DependsOnTargets="_ResolveTargetingPackContent"