forked from dotnet/roslyn-analyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeCoverage.proj
40 lines (31 loc) · 1.82 KB
/
CodeCoverage.proj
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
<Project DefaultTargets="Codecov">
<PropertyGroup>
<Language>C#</Language>
</PropertyGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<!-- We need to specify a framework in order for the Restore target to work -->
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Codecov" Version="$(CodecovVersion)" GeneratePathProperty="true" />
<PackageReference Include="ReportGenerator" Version="$(ReportGeneratorVersion)" GeneratePathProperty="true" />
</ItemGroup>
<Target Name="Codecov">
<PropertyGroup>
<_CodecovPath>$(PkgCodecov)\tools\Codecov.exe</_CodecovPath>
<_ReportGeneratorPath>$(PkgReportGenerator)\tools\net47\ReportGenerator.exe</_ReportGeneratorPath>
</PropertyGroup>
<Message Importance="high" Text=""$(_ReportGeneratorPath)" -reports:$(ArtifactsDir)TestResults\**\coverage.opencover.xml -targetdir:$(ArtifactsDir)coverage -reporttypes:Cobertura" />
<Exec Command=""$(_ReportGeneratorPath)" -reports:$(ArtifactsDir)TestResults\**\coverage.opencover.xml -targetdir:$(ArtifactsDir)coverage -reporttypes:Cobertura" />
<ItemGroup>
<_CodecovArgs Include="-f;$(ArtifactsDir)coverage\Cobertura.xml" />
<!-- Report an error if the upload fails (currently disabled due to reliability issues) -->
<_CodecovArgs Include="--required" Condition="'False' == ''" />
<_CodecovFlags Include="$(Configuration)" Condition="'$(Configuration)' != ''" />
</ItemGroup>
<Message Importance="high" Text=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovFlags, ',')" />
<Exec Command=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovFlags, ',')" />
</Target>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
</Project>