-
Notifications
You must be signed in to change notification settings - Fork 386
/
Copy pathcoverlet.collector.targets
48 lines (44 loc) · 2.32 KB
/
coverlet.collector.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!--
***********************************************************************************************
coverlet.collector.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CopyCoverletDataCollectorFiles" AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<CoverletDataCollectorFiles Include="$(MSBuildThisFileDirectory)\*.*" />
</ItemGroup>
<Copy SourceFiles="@(CoverletDataCollectorFiles)" DestinationFolder="$(PublishDir)%(RecursiveDir)" />
</Target>
<Target Name="SetXPlatDataCollectorPath" BeforeTargets="VSTest">
<PropertyGroup>
<VSTestTestAdapterPath>$(VSTestTestAdapterPath);$(MSBuildThisFileDirectory)</VSTestTestAdapterPath>
</PropertyGroup>
</Target>
<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>
<ItemGroup>
<_byProject Include="@(_LocalTopLevelSourceRoot->'%(MSBuildSourceProjectFile)')" OriginalPath="%(Identity)" />
<_mapping Include="@(_byProject->'%(Identity)|%(OriginalPath)=%(MappedPath)')" />
</ItemGroup>
<PropertyGroup>
<_sourceRootMappingFilePath>$([MSBuild]::EnsureTrailingSlash('$(OutputPath)'))CoverletSourceRootsMapping</_sourceRootMappingFilePath>
</PropertyGroup>
<WriteLinesToFile File="$(_sourceRootMappingFilePath)" Lines="@(_mapping)"
Overwrite="true" Encoding="Unicode"
Condition="'@(_mapping)'!=''"
WriteOnlyWhenDifferent="true" />
<ItemGroup>
<FileWrites Include="$(_sourceRootMappingFilePath)" Condition="'@(_mapping)'!=''" />
</ItemGroup>
</Target>
</Project>