Skip to content

Commit

Permalink
Allow modifying GenFacade's ReferencePaths input (#8389)
Browse files Browse the repository at this point in the history
There are cases where the ReferencePath item isn't the right input for GenFacades, i.e. a project's generated reference assembly might be a better candidate. Allow to override the default item to point to something different, i.e. to ReferencePathWithRefAssemblies.
  • Loading branch information
ViktorHofer authored Jan 25, 2022
1 parent 86a931a commit 35d25de
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<UsingTask TaskName="GenPartialFacadeSource" AssemblyFile="$(GenFacadesTargetAssemblyPath)" />

<PropertyGroup>
<GenFacadesReferencePathItemName Condition="'$(GenFacadesReferencePathItemName)' == ''">ReferencePath</GenFacadesReferencePathItemName>
<!-- Tell ResolveMatchingContract to run and resolve contract to project reference -->
<ResolveMatchingContract>true</ResolveMatchingContract>
<GeneratePartialFacadeSourceDependsOn>$(GeneratePartialFacadeSourceDependsOn);ResolveMatchingContract</GeneratePartialFacadeSourceDependsOn>
Expand All @@ -17,15 +18,15 @@
</PropertyGroup>

<Target Name="GeneratePartialFacadeSource"
Inputs="$(MSBuildAllProjects);@(ResolvedMatchingContract);@(ReferencePath);@(Compile)"
Inputs="$(MSBuildAllProjects);@(ResolvedMatchingContract);@($(GenFacadesReferencePathItemName));@(Compile)"
Outputs="$(OutputSourcePath)"
DependsOnTargets="$(GeneratePartialFacadeSourceDependsOn)">
<PropertyGroup>
<ReferenceAssembly>%(ResolvedMatchingContract.Identity)</ReferenceAssembly>
</PropertyGroup>

<GenPartialFacadeSource
ReferencePaths="@(ReferencePath)"
ReferencePaths="@($(GenFacadesReferencePathItemName))"
ReferenceAssembly="$(ReferenceAssembly)"
CompileFiles="@(Compile)"
DefineConstants="$(DefineConstants)"
Expand Down

0 comments on commit 35d25de

Please sign in to comment.