-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
21 lines (20 loc) · 1.05 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
21 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<Project>
<Import
Project="$(MSBuildThisFileDirectory)PackageRedirects.props"
Condition="Exists('$(MSBuildThisFileDirectory)PackageRedirects.props')"
/>
<ItemGroup>
<!-- Remove all items from PackageReference if they are in the PackageRedirect ItemGroup with a matching PackageName
element. Then add a ProjectReference to the project with the item identity in PackageRedirect. -->
<_ExcludePackage Include="@(PackageRedirect)" Exclude="@(PackageReference)">
<MatchOnMetadata>PackageName</MatchOnMetadata>
<ProjectPath>%(PackageName)</ProjectPath>
</_ExcludePackage>
<_ExcludeProjects Include="@(_ExcludePackage->Metadata('ProjectPath'))" />
<ProjectReference Include="@(PackageRedirect)" Exclude="@(_ExcludeProjects)">
<ReferenceOutputAssembly>%(PackageRedirect.ReferenceOutputAssembly)</ReferenceOutputAssembly>
<ItemOutputGroup>%(PackageRedirect.ItemOutputGroup)</ItemOutputGroup>
</ProjectReference>
<PackageReference Remove="%(PackageRedirect.PackageName)" />
</ItemGroup>
</Project>