Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Oct 14, 2022
2 parents 7fa4a79 + 66e3e19 commit 9cf6732
Show file tree
Hide file tree
Showing 83 changed files with 4,312 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.1.0",
"version": "2.2.0",
"commands": [
"dotnet-cake"
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-18.04, macos-latest]
os: [windows-latest, ubuntu-18.04, macos-latest, ubuntu-22.04]
steps:
- name: Get the sources
uses: actions/checkout@v2
Expand Down
30 changes: 30 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
### New in 2.3.0 (Released 2022/10/14)

* 3947 Easier Way to Read Process Output?.
* 3916 GitVersion: Add ShortSha property.
* 3487 Add alias for dotnet workload update command.
* 3486 Add alias for dotnet workload uninstall command.
* 3484 Add alias for dotnet workload restore command.
* 3483 Add alias for dotnet workload repair command.
* 3482 Add alias for dotnet workload list command.
* 3978 Microsoft.Extensions.DependencyInjection to 6.0.1.
* 3976 Update NuGet.* to 6.3.1.
* 3970 Update Basic.Reference.Assemblies.* to 1.3.0.
* 3965 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.3.1.
* 3956 Extensibility issue - CakeEngineActions is internal.
* 3933 Update NuGet.* to 6.3.0.
* 3920 Update Microsoft.NETCore.Platforms to 6.0.5.
* 3909 Update Autofac to 6.4.0.
* 3901 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.2.0.
* 3899 Microsoft.NETCore.Platforms to 6.0.4.
* 3897 Update NuGet.* to 6.2.1.
* 3890 Update NuGet.* to 6.2.0.
* 3880 Better support global script cache.
* 2953 Allow setting MSBuild target via MSBuildSettings using a string.
* 2591 Extensibility issue - CakeTaskBuilder is sealed and CakeTaskBuilder(CakeTask task) is internal. .
* 3931 Cake fails to load native libraries on Ubuntu 22.04.
* 3894 Guard against null Console instance on InfoFeature.
* 3879 Build script caching throws after running dry-run on non-changed Cake script.
* 3878 OpenCover filters should be case sensitive.
* 1852 Incorrect escaping of semi-colon in property values for MS Build.

### New in 2.2.0 (Released 2022/04/15)

* 3821 PostAction is not setable on DotNetSettings.
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Gitter&version=2.0.0"

// Install .NET Core Global tools.
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.8.1"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.10.3"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=SignClient&version=1.3.155"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.12.1"

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"src"
],
"sdk": {
"version": "6.0.202",
"version": "6.0.402",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/Cake.Cli/Cake.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="Spectre.Console" Version="0.44.0" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions src/Cake.Cli/Features/InfoFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Cake.Core;

namespace Cake.Cli
Expand Down Expand Up @@ -37,6 +38,11 @@ public InfoFeature(IVersionResolver resolver)
/// <inheritdoc/>
public void Run(IConsole console)
{
if (console is null)
{
throw new ArgumentNullException(nameof(console));
}

var version = _resolver.GetVersion();
var product = _resolver.GetProductVersion();

Expand Down
10 changes: 5 additions & 5 deletions src/Cake.Common.Tests/Cake.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
</ItemGroup>
<!-- Global packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="NSubstitute" Version="4.4.0" />
<PackageReference Include="Castle.Core" Version="5.1.0" />
</ItemGroup>
<!-- .NET Framework packages -->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.Command;
using Cake.Core.IO;
using Cake.Testing.Fixtures;

namespace Cake.Common.Tests.Fixtures.Tools.Command
{
internal class CommandRunnerFixture : ToolFixture<CommandSettings>
{
public ProcessArgumentBuilder Arguments { get; set; }

public string ToolName
{
get => Settings.ToolName;
set => Settings.ToolName = value;
}

public ICollection<string> ToolExecutableNames
{
get => Settings.ToolExecutableNames;
set => Settings.ToolExecutableNames = value;
}

public CommandRunnerFixture()
: base("dotnet.exe")
{
Arguments = new ProcessArgumentBuilder();
Settings.ToolName = "dotnet";
Settings.ToolExecutableNames = new[] { "dotnet.exe", "dotnet" };
}

protected override void RunTool()
{
GetRunner().RunCommand(Arguments);
}

protected CommandRunner GetRunner()
=> new CommandRunner(
Settings,
FileSystem,
Environment,
ProcessRunner,
Tools);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Cake.Common.Tests.Fixtures.Tools.Command
{
internal class CommandRunnerStandardErrorFixture : CommandRunnerStandardOutputFixture
{
public string StandardError { get; private set; }

protected override void RunTool()
{
ExitCode = GetRunner().RunCommand(Arguments, out var standardOutput, out var standardError);
StandardOutput = standardOutput;
StandardError = standardError;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Cake.Common.Tests.Fixtures.Tools.Command
{
internal class CommandRunnerStandardOutputFixture : CommandRunnerFixture
{
public int ExitCode { get; protected set; }
public string StandardOutput { get; protected set; }

protected override void RunTool()
{
ExitCode = GetRunner().RunCommand(Arguments, out var standardOutput);
StandardOutput = standardOutput;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Cake.Common.Tests.Fixtures.Tools.Command
{
internal static class CommandRunnerStandardOutputFixtureExtentions
{
public static T GivenStandardOutput<T>(this T fixture, params string[] standardOutput)
where T : CommandRunnerStandardOutputFixture
{
fixture.ProcessRunner.Process.SetStandardOutput(standardOutput);
return fixture;
}

public static T GivenStandardError<T>(this T fixture, params string[] standardError)
where T : CommandRunnerStandardOutputFixture
{
fixture.ProcessRunner.Process.SetStandardError(standardError);
return fixture;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.DotNet.Workload.Install;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Install
{
internal sealed class DotNetWorkloadInstallerFixture : DotNetFixture<DotNetWorkloadInstallSettings>
{
public IEnumerable<string> WorkloadIds { get; set; }

protected override void RunTool()
{
var tool = new DotNetWorkloadInstaller(FileSystem, Environment, ProcessRunner, Tools);
tool.Install(WorkloadIds, Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.DotNet.Workload.List;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.List
{
internal sealed class DotNetWorkloadListerFixture : DotNetFixture<DotNetWorkloadListSettings>
{
public IEnumerable<DotNetWorkloadListItem> Workloads { get; set; }

public void GivenInstalledWorkloadsResult()
{
ProcessRunner.Process.SetStandardOutput(new string[]
{
"Installed Workload Ids Manifest Version Installation Source",
"--------------------------------------------------------------------------------------",
"maui-ios 6.0.312/6.0.300 VS 17.3.32804.467, VS 17.4.32804.182",
"maui-windows 6.0.312/6.0.300 VS 17.3.32804.467, VS 17.4.32804.182",
"android 32.0.301/6.0.300 VS 17.3.32804.467, VS 17.4.32804.182",
"",
"Use `dotnet workload search` to find additional workloads to install."
});
}

public void GivenEmptyInstalledWorkloadsResult()
{
ProcessRunner.Process.SetStandardOutput(new string[]
{
"Installed Workload Ids Manifest Version Installation Source",
"---------------------------------------------------------------------",
"",
"Use `dotnet workload search` to find additional workloads to install."
});
}

protected override void RunTool()
{
var tool = new DotNetWorkloadLister(FileSystem, Environment, ProcessRunner, Tools);
Workloads = tool.List(Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tools.DotNet.Workload.Repair;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Repair
{
internal sealed class DotNetWorkloadRepairerFixture : DotNetFixture<DotNetWorkloadRepairSettings>
{
protected override void RunTool()
{
var tool = new DotNetWorkloadRepairer(FileSystem, Environment, ProcessRunner, Tools);
tool.Repair(Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tools.DotNet.Workload.Restore;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Restore
{
internal sealed class DotNetWorkloadRestorerFixture : DotNetFixture<DotNetWorkloadRestoreSettings>
{
public string Project { get; set; }

protected override void RunTool()
{
var tool = new DotNetWorkloadRestorer(FileSystem, Environment, ProcessRunner, Tools);
tool.Restore(Project, Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.DotNet.Workload.Uninstall;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Uninstall
{
internal sealed class DotNetWorkloadUninstallerFixture : DotNetFixture<DotNetWorkloadUninstallSettings>
{
public IEnumerable<string> WorkloadIds { get; set; }

protected override void RunTool()
{
var tool = new DotNetWorkloadUninstaller(FileSystem, Environment, ProcessRunner, Tools);
tool.Uninstall(WorkloadIds);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tools.DotNet.Workload.Update;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Workload.Update
{
internal sealed class DotNetWorkloadUpdaterFixture : DotNetFixture<DotNetWorkloadUpdateSettings>
{
protected override void RunTool()
{
var tool = new DotNetWorkloadUpdater(FileSystem, Environment, ProcessRunner, Tools);
tool.Update(Settings);
}
}
}
Loading

0 comments on commit 9cf6732

Please sign in to comment.