forked from dotnet/machinelearning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodecoverage.proj
44 lines (34 loc) · 2.3 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
41
42
43
44
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Codecov">
<PropertyGroup>
<!-- We need to specify a framework in order for the Restore target to work -->
<TargetFramework>net6.0</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)bin\**\coverage.opencover*.xml -targetdir:$(ArtifactsDir)bin\ -filefilters:+*.cs;+*.fs -reporttypes:Cobertura" />
<Exec Command=""$(_ReportGeneratorPath)" -reports:$(ArtifactsDir)bin\**\coverage.opencover*.xml -targetdir:$(ArtifactsDir)bin\coverage -filefilters:+*.cs;+*.fs -reporttypes:Cobertura" />
<ItemGroup>
<_CodecovArgs Include="-f;$(ArtifactsDir)bin\coverage\Cobertura.xml" />
<!-- Report an error if the upload fails -->
<_CodecovArgs Include="--required" />
<_CodecovFlags Include="$(Configuration)" Condition="'$(Configuration)' != ''" />
<_CodecovProductionFlags Include="@(_CodecovFlags)" />
<_CodecovProductionFlags Include="production" />
<_CodecovTestFlags Include="@(_CodecovFlags)" />
<_CodecovTestFlags Include="test" />
</ItemGroup>
<!-- Upload the coverage file with a 'production' flag, which will be filtered by codecov.io to production code -->
<Message Importance="high" Text=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovProductionFlags, ',')" />
<Exec Command=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovProductionFlags, ',')" />
<!-- Upload the coverage file with a 'test' flag, which will be filtered by codecov.io to test code -->
<Message Importance="high" Text=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovTestFlags, ',')" />
<Exec Command=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovTestFlags, ',')" />
</Target>
</Project>