diff --git a/setup.cake b/setup.cake index d1a2d2a..3ce6e14 100644 --- a/setup.cake +++ b/setup.cake @@ -14,7 +14,7 @@ BuildParameters.SetParameters( appVeyorAccountName: "cakecontrib", shouldRunDotNetCorePack: true, shouldGenerateDocumentation: false, - shouldRunCodecov: false, + shouldRunCodecov: true, shouldRunCoveralls: false, shouldUseDeterministicBuilds: true, shouldUseTargetFrameworkPath: false, @@ -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((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((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(); + var environmentVariables = new Dictionary(); -// 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();