Skip to content

Commit

Permalink
Run CollectPackageReferences on dynamically referenced projects for N…
Browse files Browse the repository at this point in the history
…uGet.

This gets the project.assets.json to contain all of the right things so
that the Runner project gets transitive dependencies from dynamically referenced
projects (in this case, Injectable).
  • Loading branch information
binki committed May 23, 2019
1 parent a7a78a4 commit 9ec436f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Runner/Build/AddDynamicReferences.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,21 @@
<ProjectReference Include="@(MyDynamicProjectReference)"/>
</ItemGroup>
</Target>
<!--
Make up for NuGet’s inability to collect package references by
loading them from dependencies. This way, we can make transitive
dependencies sort of work.
-->
<Target BeforeTargets="CollectPackageReferences" DependsOnTargets="MyCollectDynamicProjectReferences" Name="MyCollectPackageReferences">
<MSBuild
BuildInParallel="$(BuildInParallel)"
Projects="@(MyDynamicProjectReference)"
Targets="CollectPackageReferences"
>
<Output
ItemName="PackageReference"
TaskParameter="TargetOutputs"
/>
</MSBuild>
</Target>
</Project>

0 comments on commit 9ec436f

Please sign in to comment.