Skip to content

Commit

Permalink
Merge pull request #269 from Insire/dev
Browse files Browse the repository at this point in the history
use the old nuget package for uploading coverage reports
  • Loading branch information
Insire authored Feb 19, 2023
2 parents b7895e1 + a953d4e commit f36fd5d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cake/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
<PackageReference Include="Cake.GitVersioning" Version="3.5.119" />
<PackageReference Include="Cake.Incubator" Version="8.0.0" />
<PackageReference Include="CodecovUploader" Version="0.3.2" />
<PackageReference Include="Codecov" Version="1.13.0" />
<PackageReference Include="GitVersion.CommandLine" Version="5.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 2 additions & 1 deletion cake/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public BuildContext(ICakeContext context)

CoveragePath = ResultsPath.Combine("coverage").MakeAbsolute(workingDirectory);
ReportsPath = ResultsPath.Combine("reports").MakeAbsolute(workingDirectory);
CoberturaResultsPath = ReportsPath.Combine("cobertura").MakeAbsolute(workingDirectory);

NugetPackageProjects = new[]
{
Expand All @@ -63,7 +64,7 @@ public BuildContext(ICakeContext context)

SolutionFile = FilePath.FromString("MvvmScarletToolkit.sln").MakeAbsolute(workingDirectory);
AssemblyInfoFile = SourcePath.CombineWithFilePath("SharedAssemblyInfo.cs").MakeAbsolute(workingDirectory);
CoberturaResultFile = ReportsPath.Combine("cobertura").CombineWithFilePath("Cobertura.xml").MakeAbsolute(workingDirectory);
CoberturaResultFile = CoberturaResultsPath.CombineWithFilePath("Cobertura.xml").MakeAbsolute(workingDirectory);

IsPublicRelease = context.EnvironmentVariable("PublicRelease", false);
}
Expand Down
2 changes: 1 addition & 1 deletion cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class Program
public static int Main(string[] args)
{
return new CakeHost()
.InstallTool(new Uri("nuget:?package=CodecovUploader&version=0.3.2"))
.InstallTool(new Uri("nuget:?package=Codecov&version=1.13.0"))
.InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.16.2"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=5.1.17"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.12.0"))
Expand Down
8 changes: 8 additions & 0 deletions cake/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"Build": {
"commandName": "Project",
"commandLineArgs": "-t UploadCodecovReport -v diagnostic"
}
}
}
15 changes: 14 additions & 1 deletion cake/Tasks/UploadCodecovReport.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using Cake.Codecov;
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Core;
using Cake.Frosting;

namespace Build
Expand All @@ -10,7 +13,17 @@ public sealed class UploadCodecovReport : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.Codecov(new[] { context.CoberturaResultFile.FullPath }, context.EnvironmentVariable("CODECOV_TOKEN"));
var settings = new CodecovSettings()
{
Required = true,
Verbose = true,
WorkingDirectory = context.CoberturaResultsPath,
DisableNetwork = true,
Files = new[] { context.CoberturaResultFile.FullPath },
Token = context.EnvironmentVariable("CODECOV_TOKEN"),
};

context.Codecov(settings);
}

public override bool ShouldRun(BuildContext context)
Expand Down
1 change: 0 additions & 1 deletion src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

[assembly: AssemblyCompany("SoftThorn")]
[assembly: AssemblyProduct("MvvmScarletToolkit")]

[assembly: AssemblyCopyright("© 2023 Insire")]
[assembly: AssemblyTrademark("")]

Expand Down

0 comments on commit f36fd5d

Please sign in to comment.