Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Codecov.Tool with CodecovUploader #1357

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Nuke.Common/Tools/Codecov/Codecov.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.<para/><ul><li>hit - indicates that the source code was executed by the test suite.</li><li>partial - indicates that the source code was not fully executed by the test suite; there are remaining branches that were not executed.</li><li>miss - indicates that the source code was not executed by the test suite.</li></ul><para/>Coverage is the ratio of <c>hits / (sum of hit + partial + miss)</c>. A code base that has 5 lines executed by tests out of 12 total lines will receive a coverage ratio of 41% (rounding down).<para/>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.<para/>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": [
{
Expand Down
18 changes: 13 additions & 5 deletions source/Nuke.Common/Tools/Codecov/CodecovTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ 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()
{
if (EnvironmentInfo.IsWin)
return "codecov.exe";
if (EnvironmentInfo.IsOsx)
return "codecov-macos";
return "codecov-linux";
}
}