|
2 | 2 | #tool "dotnet:?package=coveralls.net&version=4.0.1"
|
3 | 3 | #addin nuget:?package=Newtonsoft.Json
|
4 | 4 | #addin nuget:?package=System.Text.Encodings.Web&version=4.7.1
|
5 |
| -#tool "nuget:?package=ReportGenerator" |
| 5 | +#tool "nuget:?package=ReportGenerator&version=5.1.19" |
6 | 6 | #addin Cake.Coveralls&version=1.1.0
|
7 | 7 |
|
8 | 8 | // compile
|
@@ -193,9 +193,7 @@ Task("RunUnitTests")
|
193 | 193 | Information(coverageSummaryFile);
|
194 | 194 | Information(artifactsForUnitTestsDir);
|
195 | 195 |
|
196 |
| - // todo bring back report generator to get a friendly report |
197 |
| - // ReportGenerator(coverageSummaryFile, artifactsForUnitTestsDir); |
198 |
| - // https://github.com/danielpalme/ReportGenerator |
| 196 | + GenerateReport(coverageSummaryFile); |
199 | 197 |
|
200 | 198 | if (IsRunningOnCircleCI() && IsMain())
|
201 | 199 | {
|
@@ -365,6 +363,21 @@ Task("PublishToNuget")
|
365 | 363 |
|
366 | 364 | RunTarget(target);
|
367 | 365 |
|
| 366 | +private void GenerateReport(Cake.Core.IO.FilePath coverageSummaryFile) |
| 367 | +{ |
| 368 | + var dir = System.IO.Directory.GetCurrentDirectory(); |
| 369 | + Information(dir); |
| 370 | + |
| 371 | + var reportSettings = new ProcessArgumentBuilder(); |
| 372 | + reportSettings.Append($"-targetdir:" + $"{dir}/{artifactsForUnitTestsDir}"); |
| 373 | + reportSettings.Append($"-reports:" + coverageSummaryFile); |
| 374 | + |
| 375 | + var toolpath = Context.Tools.Resolve("net7.0/ReportGenerator.dll"); |
| 376 | + Information($"Tool Path : {toolpath.ToString()}"); |
| 377 | + |
| 378 | + DotNetExecute(toolpath, reportSettings); |
| 379 | +} |
| 380 | + |
368 | 381 | /// Gets unique nuget version for this commit
|
369 | 382 | private GitVersion GetNuGetVersionForCommit()
|
370 | 383 | {
|
|
0 commit comments