Skip to content

Commit

Permalink
(maint) Enable dogfooding of library
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed May 2, 2024
1 parent 3182603 commit 6a45d24
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions setup.cake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BuildParameters.SetParameters(
appVeyorAccountName: "cakecontrib",
shouldRunDotNetCorePack: true,
shouldGenerateDocumentation: false,
shouldRunCodecov: false,
shouldRunCodecov: true,
shouldRunCoveralls: false,
shouldUseDeterministicBuilds: true,
shouldUseTargetFrameworkPath: false,
Expand All @@ -29,36 +29,36 @@ ToolSettings.SetToolSettings(
ToolSettings.SetToolPreprocessorDirectives(codecovTool: "#tool nuget:?package=CodecovUploader&version=0.7.3");

// Tasks we want to override
// ((CakeTask)BuildParameters.Tasks.UploadCodecovReportTask.Task).Actions.Clear();
// BuildParameters.Tasks.UploadCodecovReportTask
// .IsDependentOn("DotNetCore-Pack")
// .Does<BuildVersion>((version) => RequireTool(BuildParameters.IsDotNetCoreBuild ? ToolSettings.CodecovGlobalTool : ToolSettings.CodecovTool, () => {
// var nugetPkg = $"nuget:file://{MakeAbsolute(BuildParameters.Paths.Directories.NuGetPackages)}?package=Cake.Codecov&version={version.SemVersion}&prerelease";
// Information("PATH: " + nugetPkg);
((CakeTask)BuildParameters.Tasks.UploadCodecovReportTask.Task).Actions.Clear();
BuildParameters.Tasks.UploadCodecovReportTask
.IsDependentOn("DotNetCore-Pack")
.Does<BuildVersion>((version) => RequireTool(ToolSettings.CodecovTool, () => {
var nugetPkg = $"nuget:file://{MakeAbsolute(BuildParameters.Paths.Directories.NuGetPackages)}?package=Cake.Codecov&version={version.SemVersion}&prerelease";
Information("PATH: " + nugetPkg);

// var coverageFilter = BuildParameters.Paths.Directories.TestCoverage + "/coverlet/*.xml";
// Information($"Passing coverage filter to codecov: \"{coverageFilter}\"");
var coverageFilter = BuildParameters.Paths.Directories.TestCoverage + "/coverlet/*.xml";
Information($"Passing coverage filter to codecov: \"{coverageFilter}\"");

// var environmentVariables = new Dictionary<string, string>();
var environmentVariables = new Dictionary<string, string>();

// if (version != null && !string.IsNullOrEmpty(version.FullSemVersion) && BuildParameters.BuildProvider.SupportsTokenlessCodecov)
// {
// var buildVersion = string.Format("{0}.build.{1}",
// version.FullSemVersion,
// BuildSystem.AppVeyor.Environment.Build.Number);
// environmentVariables.Add("APPVEYOR_BUILD_VERSION", buildVersion);
// }
if (version != null && !string.IsNullOrEmpty(version.FullSemVersion) && BuildParameters.BuildProvider.SupportsTokenlessCodecov)
{
var buildVersion = string.Format("{0}.build.{1}",
version.FullSemVersion,
BuildSystem.AppVeyor.Environment.Build.Number);
environmentVariables.Add("APPVEYOR_BUILD_VERSION", buildVersion);
}

// var script = string.Format(@"#addin ""{0}""
// Codecov(new CodecovSettings {{
// Files = new[] {{ ""{1}"" }},
// Root = ""{2}"",
// Required = true
// }});",
// nugetPkg, coverageFilter, BuildParameters.RootDirectoryPath);
var script = string.Format(@"#addin ""{0}""
Codecov(new CodecovSettings {{
Files = new[] {{ ""{1}"" }},
Root = ""{2}"",
Required = true
}});",
nugetPkg, coverageFilter, BuildParameters.RootDirectoryPath);

// RequireAddin(script, environmentVariables);
// })
// );
RequireAddin(script, environmentVariables);
})
);

Build.RunDotNetCore();

0 comments on commit 6a45d24

Please sign in to comment.