Skip to content

Commit

Permalink
[Msbuild]Ensure that the nearest TFM is passed in to the target proje…
Browse files Browse the repository at this point in the history
…ct (#819)

[Msbuild]Ensure that the nearest TFM is passed in to the target project
  • Loading branch information
clairernovotny authored Apr 17, 2020
1 parent 3c87c1b commit a0e22ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/coverlet.msbuild.tasks/coverlet.msbuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<UsingTask TaskName="Coverlet.MSbuild.Tasks.InstrumentationTask" AssemblyFile="$(CoverletToolsPath)coverlet.msbuild.tasks.dll"/>
<UsingTask TaskName="Coverlet.MSbuild.Tasks.CoverageResultTask" AssemblyFile="$(CoverletToolsPath)coverlet.msbuild.tasks.dll"/>

<Target Name="ReferencedPathMaps" BeforeTargets="CoreCompile" >
<MSBuild Projects="@(ProjectReference->'%(FullPath)')"
Targets="CoverletGetPathMap" SkipNonexistentTargets="true">
<Target Name="ReferencedPathMaps" BeforeTargets="CoreCompile" DependsOnTargets="ResolveProjectReferences" >
<MSBuild Projects="@(AnnotatedProjects->'%(FullPath)')"
Targets="CoverletGetPathMap"
Properties="TargetFramework=%(AnnotatedProjects.NearestTargetFramework)"
SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs"
ItemName="_LocalTopLevelSourceRoot" />
</MSBuild>
Expand Down Expand Up @@ -69,4 +71,4 @@
AfterTargets="VSTest"
DependsOnTargets="GenerateCoverageResult"
Condition="'$(CollectCoverage)' == 'true'" />
</Project>
</Project>

0 comments on commit a0e22ec

Please sign in to comment.