Skip to content

Commit

Permalink
Add workaround to remove runtime pack from download to use local runt…
Browse files Browse the repository at this point in the history
…ime pack (dotnet#45922)

* Add workaround to remove runtime pack from download to use local runtime pack

* PR Feedback

* Add support for full msbuild
  • Loading branch information
safern authored Dec 11, 2020
1 parent c82d66d commit 30be1b9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eng/targetingpacks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@
</PropertyGroup>
</Target>

<!-- SDK tries to download runtime packs when RuntimeIdentifier is set, remove them from PackageDownload item. -->
<Target Name="RemoveRuntimePackFromDownloadItem"
Condition="'$(_UseLocalTargetingRuntimePack)' == 'true'"
AfterTargets="ProcessFrameworkReferences">
<ItemGroup>
<PackageDownload Remove="@(PackageDownload)"
Condition="'$(UsePackageDownload)' == 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(SharedFrameworkName).Runtime'))" />
<PackageReference Remove="@(PackageReference)"
Condition="'$(UsePackageDownload)' != 'true' and $([System.String]::Copy('%(Identity)').StartsWith('$(SharedFrameworkName).Runtime'))" />
</ItemGroup>
</Target>

<!-- Use local targeting pack for NetCoreAppCurrent. -->
<Target Name="UpdateTargetingAndRuntimePack"
Condition="'$(_UseLocalTargetingRuntimePack)' == 'true'"
Expand Down

0 comments on commit 30be1b9

Please sign in to comment.