|
6 | 6 | </PropertyGroup> |
7 | 7 |
|
8 | 8 | <ItemGroup> |
9 | | - <PackageReference Include="Codecov" Version="$(CodecovVersion)" /> |
10 | | - <PackageReference Include="ReportGenerator" Version="$(ReportGeneratorVersion)" /> |
| 9 | + <PackageReference Include="Codecov" Version="$(CodecovVersion)" GeneratePathProperty="true" /> |
| 10 | + <PackageReference Include="ReportGenerator" Version="$(ReportGeneratorVersion)" GeneratePathProperty="true" /> |
11 | 11 | </ItemGroup> |
12 | | - <Target Name="Codecov" DependsOnTargets="Restore"> |
| 12 | + |
| 13 | + <Target Name="Codecov"> |
13 | 14 | <PropertyGroup> |
14 | | - <_CodecovPath>$(RestorePackagesPath)codecov\$(CodecovVersion)\tools\Codecov.exe</_CodecovPath> |
15 | | - <_ReportGeneratorPath>$(RestorePackagesPath)reportgenerator\$(ReportGeneratorVersion)\tools\net47\ReportGenerator.exe</_ReportGeneratorPath> |
16 | | - <_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_SOURCEBRANCH)</_BranchName> |
17 | | - <_BranchName Condition="'$(_BranchName)' == ''">$(BUILD_SOURCEBRANCHNAME)</_BranchName> |
| 15 | + <_CodecovPath>$(PkgCodecov)\tools\Codecov.exe</_CodecovPath> |
| 16 | + <_ReportGeneratorPath>$(PkgReportGenerator)\tools\net47\ReportGenerator.exe</_ReportGeneratorPath> |
18 | 17 | </PropertyGroup> |
19 | 18 |
|
20 | 19 | <Message Importance="high" Text=""$(_ReportGeneratorPath)" -reports:$(BaseOutputPath)$(PlatformConfig)\coverage\*.coverage -targetdir:$(BaseOutputPath)$(PlatformConfig)\coverage -filefilters:+https*;+*.fs -reporttypes:Cobertura" /> |
21 | 20 | <Exec Command=""$(_ReportGeneratorPath)" -reports:$(BaseOutputPath)$(PlatformConfig)\coverage\*.coverage -targetdir:$(BaseOutputPath)$(PlatformConfig)\coverage -filefilters:+https*;+*.fs -reporttypes:Cobertura" /> |
22 | 21 |
|
23 | 22 | <ItemGroup> |
24 | 23 | <_CodecovArgs Include="-f;$(BaseOutputPath)$(PlatformConfig)\coverage\Cobertura.xml" /> |
25 | | - <_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> |
26 | | - <_CodecovArgs Include="--pr;$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)" Condition="'$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)' != ''" /> |
27 | | - <_CodecovArgs Include="-b;$(BUILD_BUILDNUMBER)" Condition="'$(BUILD_BUILDNUMBER)' != ''" /> |
28 | | - <_CodecovArgs Include="--branch;$(_BranchName)" Condition="'$(_BranchName)' != ''" /> |
29 | | - <_CodecovArgs Include="-c;$(BUILD_SOURCEVERSION)" Condition="'$(BUILD_SOURCEVERSION)' != ''" /> |
30 | | - <_CodecovArgs Include="-n;$(BUILD_DEFINITIONNAME)" Condition="'$(BUILD_DEFINITIONNAME)' != ''" /> |
31 | | - <_CodecovArgs Include="-t;$(CodeCovToken)" Condition="'$(CodeCovToken)' != ''" /> |
| 24 | + |
| 25 | + <!-- Report an error if the upload fails --> |
| 26 | + <_CodecovArgs Include="--required" /> |
32 | 27 |
|
33 | 28 | <_CodecovFlags Include="$(Configuration)" Condition="'$(Configuration)' != ''" /> |
34 | 29 | <_CodecovProductionFlags Include="@(_CodecovFlags)" /> |
|
0 commit comments