Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 9de8081

Browse files
committed
[MSBuild] Use intersection assembly directory for assembly resolution
By default use the directory containing the intersection assembly when resolving assemblies using ApiIntersect. This directory is passed to the ApiIntersect tool using the -r parameter. This behaviour can be overridden by setting an EnableDefaultIntersectionAssemblyReferencePath MSBuild property to false. It is true by default.
1 parent dc1f17d commit 9de8081

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,20 @@ Copyright (c) .NET Foundation. All rights reserved.
517517
Inputs="@(IntersectionAssembly)"
518518
Outputs="@(_ReferenceAssemblyTargetPath)">
519519

520+
<PropertyGroup>
521+
<EnableDefaultIntersectionAssemblyReferencePath Condition="'$(EnableDefaultIntersectionAssemblyReferencePath)' == ''">true</EnableDefaultIntersectionAssemblyReferencePath>
522+
</PropertyGroup>
523+
524+
<ItemGroup>
525+
<_IntersectionReferencePath Include="@(IntersectionAssembly->'%(RootDir)%(Directory)')" Condition="'$(EnableDefaultIntersectionAssemblyReferencePath)' == 'true'" />
526+
<_IntersectionReferencePath Include="$(IntersectionAssemblyReferencePath)" />
527+
</ItemGroup>
528+
520529
<ApiIntersect
521530
Framework="%(ReferenceAssemblyFramework.Identity)"
522531
RootOutputDirectory="$(IntermediateOutputPath)"
523532
IntersectionAssembly="@(IntersectionAssembly)"
524-
ReferencePath="$(IntersectionAssemblyReferencePath)"
533+
ReferencePath="@(_IntersectionReferencePath)"
525534
ExcludeType="$(IntersectionExcludeType)"
526535
RemoveAbstractTypeMembers="$(IntersectionRemoveAbstractTypeMembers)"
527536
ExcludeAssembly="@(IntersectionExcludeAssembly)"

0 commit comments

Comments
 (0)