Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Nov 10, 2023
2 parents 2221be1 + 5857ac2 commit 1514512
Show file tree
Hide file tree
Showing 51 changed files with 1,095 additions and 81 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": "3.0.0",
"version": "3.1.0",
"commands": [
"dotnet-cake"
]
Expand Down
12 changes: 12 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### New in 3.2.0 (Released 2023/11/10)

* 4225 Add DotNetRemovePackage alias for dotnet remove package command.
* 4187 Add DotNetAddPackage alias for dotnet add package command.
* 4221 Add Azure Pipelines group logging commands.
* 4219 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.7.0.
* 4217 Update NuGet.* to 6.7.0.
* 4215 Update Autofac to 7.1.0.
* 4157 Upgrading to spectre.console 0.47.0 breaks the cake build.
* 4144 DotNetMSBuildSettings is missing NodeReuse.
* 3996 Error: Bad IL format with Cake MacOSX (2.3.0 - 3.1.0).

### New in 3.1.0 (Released 2023/07/09)

* 4122 Call multiple tasks from CLI in Frosting.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Version | Supported |
| --------- | ------------------ |
| 3.x.x | :white_check_mark: |
| 2.x.x | :white_check_mark: |
| 2.x.x | :x: |
| 1.0.x | :x: |
| 0.38.5 | :x: |
| <= 0.38.4 | :x: |
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Install .NET Core Global tools.
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.12.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.13.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=sign&version=0.9.1-beta.23274.1&prerelease"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=sign&version=0.9.1-beta.23530.1&prerelease"

// Load other scripts.
#load "./build/parameters.cake"
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": "7.0.305",
"version": "7.0.403",
"rollForward": "latestFeature"
}
}
6 changes: 3 additions & 3 deletions src/Cake.Cli/Cake.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="7.0.1" />
<PackageReference Include="Spectre.Console" Version="0.46.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.46.0" />
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Spectre.Console" Version="0.47.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.47.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/Cake.Common.Tests/Cake.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
</ItemGroup>
<!-- Global packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Castle.Core" Version="5.1.1" />
</ItemGroup>
<!-- .NET Framework packages -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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.Package.Add;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Package.Add
{
internal sealed class DotNetPackageAdderFixture : DotNetFixture<DotNetPackageAddSettings>
{
public string PackageName { get; set; }

public string Project { get; set; }

protected override void RunTool()
{
var tool = new DotNetPackageAdder(FileSystem, Environment, ProcessRunner, Tools);
tool.Add(PackageName, Project, Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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.Package.Remove;

namespace Cake.Common.Tests.Fixtures.Tools.DotNet.Package.Remove
{
internal sealed class DotNetPackageRemoverFixture : DotNetFixture<DotNetPackageRemoveSettings>
{
public string PackageName { get; set; }

public string Project { get; set; }

protected override void RunTool()
{
var tool = new DotNetPackageRemover(FileSystem, Environment, ProcessRunner, Tools);
tool.Remove(PackageName, Project);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,48 @@ public void Should_Log_Error_Message_With_Data()
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.logissue sourcepath=./code.cs;linenumber=1;columnnumber=2;code=3;type=error;]build error");
}

[Fact]
public void Should_Begin_Group_With_Name()
{
// Given
var fixture = new AzurePipelinesFixture();
var service = fixture.CreateAzurePipelinesService();

// When
service.Commands.BeginGroup("Example Group");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##[group]Example Group");
}

[Fact]
public void Should_End_Group()
{
// Given
var fixture = new AzurePipelinesFixture();
var service = fixture.CreateAzurePipelinesService();

// When
service.Commands.EndGroup();

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##[endgroup]");
}

[Fact]
public void Should_Section_With_Name()
{
// Given
var fixture = new AzurePipelinesFixture();
var service = fixture.CreateAzurePipelinesService();

// When
service.Commands.Section("Example Section");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##[section]Example Section");
}

[Fact]
public void Should_Set_Current_Progress()
{
Expand All @@ -152,7 +194,7 @@ public void Should_Complete_Current_Task()
service.Commands.CompleteCurrentTask();

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.complete ]DONE");
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.complete]DONE");
}

[Fact]
Expand Down Expand Up @@ -281,7 +323,7 @@ public void Should_Upload_Task_Summary()
service.Commands.UploadTaskSummary("./summary.md");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.uploadsummary ]{path}");
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.uploadsummary]{path}");
}

[Fact]
Expand All @@ -296,7 +338,7 @@ public void Should_Upload_Task_Log()
service.Commands.UploadTaskLogFile("./logs/task.log");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.uploadfile ]{path}");
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[task.uploadfile]{path}");
}

[Theory]
Expand Down Expand Up @@ -432,7 +474,7 @@ public void Should_Upload_Build_Log()
service.Commands.UploadBuildLogFile("./dist/buildlog.txt");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[build.uploadlog ]{path}");
Assert.Contains(fixture.Writer.Entries, m => m == $"##vso[build.uploadlog]{path}");
}

[Fact]
Expand All @@ -446,7 +488,7 @@ public void Should_Update_Build_Number()
service.Commands.UpdateBuildNumber("CIBuild_1");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == "##vso[build.updatebuildnumber ]CIBuild_1");
Assert.Contains(fixture.Writer.Entries, m => m == "##vso[build.updatebuildnumber]CIBuild_1");
}

[Fact]
Expand All @@ -460,7 +502,7 @@ public void Should_Add_Build_Tag()
service.Commands.AddBuildTag("Stable");

// Then
Assert.Contains(fixture.Writer.Entries, m => m == "##vso[build.addbuildtag ]Stable");
Assert.Contains(fixture.Writer.Entries, m => m == "##vso[build.addbuildtag]Stable");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Cake.Common.Tests.Fixtures.Tools;
using Cake.Common.Tests.Fixtures.Tools.DotNet.MSBuild;
using Cake.Common.Tools.DotNet;
using Cake.Common.Tools.DotNet.MSBuild;
Expand Down Expand Up @@ -801,6 +802,20 @@ public void Should_Add_Host_Arguments()
// Then
Assert.Equal("--diagnostics msbuild", result.Args);
}

[Fact]
public void Should_Use_Node_Reuse_If_Specified()
{
// Given
var fixture = new DotNetMSBuildBuilderFixture();
fixture.Settings.NodeReuse = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("msbuild /nodeReuse:true", result.Args);
}
}

public class TheConsoleLoggerSettingsProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,37 @@ public void Should_Return_The_Same_Configuration()
}
}

public sealed class TheNodeReuseMethod
{
[Theory]
[InlineData(true)]
[InlineData(false)]
public void Should_Set_Node_Reuse(bool reuse)
{
// Given
var settings = new DotNetMSBuildSettings();

// When
settings.SetNodeReuse(reuse);

// Then
Assert.Equal(reuse, settings.NodeReuse);
}

[Fact]
public void Should_Return_The_Same_Configuration()
{
// Given
var settings = new DotNetMSBuildSettings();

// When
var result = settings.SetNodeReuse(true);

// Then
Assert.Equal(settings, result);
}
}

public sealed class TheSetConfigurationMethod
{
private const string Configuration = "TheConfiguration";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,18 @@ public void Should_Be_Empty_By_Default()
Assert.Empty(settings.DistributedLoggers);
}
}

public sealed class TheNodeReuseProperty
{
[Fact]
public void Should_Be_Null_By_Default()
{
// Given
var settings = new DotNetMSBuildSettings();

// Then
Assert.Null(settings.NodeReuse);
}
}
}
}
Loading

0 comments on commit 1514512

Please sign in to comment.