diff --git a/source/Nuke.Common/Tools/Codecov/Codecov.json b/source/Nuke.Common/Tools/Codecov/Codecov.json
index 08b9b6cb0..2f70d769d 100644
--- a/source/Nuke.Common/Tools/Codecov/Codecov.json
+++ b/source/Nuke.Common/Tools/Codecov/Codecov.json
@@ -6,7 +6,7 @@
"name": "Codecov",
"officialUrl": "https://about.codecov.io/",
"help": "Code coverage is a measurement used to express which lines of code were executed by a test suite. We use three primary terms to describe each line executed.
- hit - indicates that the source code was executed by the test suite.
- partial - indicates that the source code was not fully executed by the test suite; there are remaining branches that were not executed.
- miss - indicates that the source code was not executed by the test suite.
Coverage is the ratio of hits / (sum of hit + partial + miss). A code base that has 5 lines executed by tests out of 12 total lines will receive a coverage ratio of 41% (rounding down).Phrased simply, code coverage provides a visual measurement of what source code is being executed by a test suite. This information indicates to the software developer where they should write new tests in an effort to achieve higher coverage.Testing source code helps to prevent bugs and syntax errors by executing each line with a known variable and cross-checking it with an expected output.",
- "nugetPackageId": "Codecov.Tool",
+ "nugetPackageId": "CodecovUploader",
"customExecutable": true,
"tasks": [
{
diff --git a/source/Nuke.Common/Tools/Codecov/CodecovTasks.cs b/source/Nuke.Common/Tools/Codecov/CodecovTasks.cs
index b63f68263..1ca823c87 100644
--- a/source/Nuke.Common/Tools/Codecov/CodecovTasks.cs
+++ b/source/Nuke.Common/Tools/Codecov/CodecovTasks.cs
@@ -2,6 +2,7 @@
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
+using System;
using Nuke.Common.Tooling;
namespace Nuke.Common.Tools.Codecov;
@@ -10,17 +11,27 @@ partial class CodecovSettings
{
private string GetProcessToolPath()
{
- return CodecovTasks.GetToolPath(Framework);
+ return CodecovTasks.GetToolPath();
}
}
partial class CodecovTasks
{
- internal static string GetToolPath(string framework = null)
+ internal static string GetToolPath()
{
return NuGetToolPathResolver.GetPackageExecutable(
- packageId: "Codecov.Tool",
- packageExecutable: "codecov.dll",
- framework: framework);
+ packageId: "CodecovUploader",
+ packageExecutable: GetPackageExecutable());
+ }
+
+ private static string GetPackageExecutable()
+ {
+ return EnvironmentInfo.Platform switch
+ {
+ PlatformFamily.Windows => "codecov.exe",
+ PlatformFamily.OSX => "codecov-macos",
+ PlatformFamily.Linux => "codecov-linux",
+ _ => throw new ArgumentOutOfRangeException()
+ };
}
}