Skip to content

Commit

Permalink
Merge pull request #309 from AdmiringWorm/update-cake
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm authored May 4, 2024
2 parents 97d606c + 52c308e commit f5d0968
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# codecov in cake.recipe needs 2.1!
# version used for GitReleaseManager needs .NET Core 3.0
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Build Addin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# codecov in cake.recipe needs 2.1!
# version used for GitReleaseManager needs .NET Core 3.0
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Set up git version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# codecov in cake.recipe needs 2.1!
# version used for GitReleaseManager needs .NET Core 3.0
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
- name: Set up git version
Expand Down
5 changes: 2 additions & 3 deletions Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">net5.0;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">net5.0;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AppVeyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Cake.Testing" Version="1.1.0" />
<PackageReference Include="Cake.Testing" Version="2.3.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
9 changes: 5 additions & 4 deletions Source/Cake.Codecov.Tests/CodecovRunnerFixture.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.InteropServices;
using Cake.Codecov.Internals;
using Cake.Testing.Fixtures;

Expand All @@ -8,7 +9,7 @@ internal class CodecovRunnerFixture : ToolFixture<CodecovSettings>
private readonly IPlatformDetector _platformDetector;

public CodecovRunnerFixture()
: base("codecov.exe")
: base(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "codecov.exe" : "codecov")
{
}

Expand All @@ -20,9 +21,9 @@ public CodecovRunnerFixture(IPlatformDetector platformDetector, string expectedE

protected override void RunTool()
{
var tool = _platformDetector != null ?
new CodecovRunner(_platformDetector, FileSystem, Environment, ProcessRunner, Tools) :
new CodecovRunner(FileSystem, Environment, ProcessRunner, Tools);
var tool = _platformDetector != null
? new CodecovRunner(_platformDetector, FileSystem, Environment, ProcessRunner, Tools)
: new CodecovRunner(FileSystem, Environment, ProcessRunner, Tools);
tool.Run(Settings);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Cake.Codecov/Cake.Codecov.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Description>Cake addin that extends Cake with the ability to use the official Codecov CLI.</Description>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Cake.Codecov.xml</DocumentationFile>
<NeutralLanguage>en-GB</NeutralLanguage>
<TargetFrameworks>net5.0;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<!-- Package information -->
Expand All @@ -27,15 +27,15 @@
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
<None Include="../../README.md" Pack="true" PackagePath="docs/"/>
<None Include="../../README.md" Pack="true" PackagePath="docs/" />
</ItemGroup>
<!-- Package References -->
<ItemGroup>
<PackageReference Include="Cake.Addin.Analyzer" Version="0.1.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Cake.Core" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Core" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="CakeContrib.Guidelines" Version="1.4.0" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
Expand Down
7 changes: 4 additions & 3 deletions Source/Cake.Codecov/CodecovRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ protected override IEnumerable<string> GetToolExecutableNames()
}
else
{
// Just to make sonarlint happy :)
// The official version of Codecov CLI can not run with the exe
// on anything other than Windows. As such we only return this
// in the else statement.
yield return "codecov.exe";
}

yield return "codecov.exe";
}

protected override string GetToolName() => "Codecov";
Expand Down
3 changes: 2 additions & 1 deletion setup.cake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ToolSettings.SetToolPreprocessorDirectives(
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";
// var nugetPkg = $"nuget:file://{MakeAbsolute(BuildParameters.Paths.Directories.NuGetPackages)}?package=Cake.Codecov&version={version.SemVersion}&prerelease";
var nugetPkg = "nuget:?package=Cake.Codecov&version=1.1.0"; // We are unable to dogfood the library until Cake.Recipe supports Cake 2.0.0
Information("PATH: " + nugetPkg);
var coverageFilter = BuildParameters.Paths.Directories.TestCoverage + "/coverlet/*.xml";
Expand Down

0 comments on commit f5d0968

Please sign in to comment.