Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Nov 8, 2022
2 parents 9cf6732 + 5a19940 commit 7728438
Show file tree
Hide file tree
Showing 289 changed files with 14,313 additions and 6,310 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.2.0",
"version": "2.3.0",
"commands": [
"dotnet-cake"
]
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,37 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-18.04, macos-latest, ubuntu-22.04]
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- name: Get the sources
uses: actions/checkout@v2

- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- name: Install .NET Core SDK 3.1.x
uses: actions/setup-dotnet@v1
uses: actions/checkout@v3
with:
dotnet-version: '3.1.x'
fetch-depth: 0

- name: Install .NET Core SDK 5.0.x
uses: actions/setup-dotnet@v1
- name: Install .NET SDK 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
dotnet-version: '6.0.x'

- name: Install .NET Core SDK (global.json)
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
include-prerelease: 'true'
global-json-file: global.json

- name: Run Cake script
id: build-cake
uses: cake-build/cake-action@v1
with:
target: Run-Integration-Tests
cake-version: tool-manifest

- name: Validate Integration Tests
id: validate-cake
uses: cake-build/cake-action@master
with:
script-path: tests/integration/Cake.Common/Build/GitHubActions/ValidateGitHubActionsProvider.cake
cake-version: tool-manifest
arguments: |
CAKE_NETCOREAPP_6_0_VERSION_OS: ${{ steps.build-cake.outputs.CAKE_NETCOREAPP_6_0_VERSION_OS }}
CAKE_NETCOREAPP_7_0_VERSION_OS: ${{ steps.build-cake.outputs.CAKE_NETCOREAPP_7_0_VERSION_OS }}
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand All @@ -20,17 +20,17 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
image: cakebuild/cake:2.1-sdk-mono
image: cakebuild/cake:sdk-7.0
stages:
- build

build_job:
stage: build
script:
- git fetch --unshallow || true
- ./build.sh --target="Run-Unit-Tests"
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 2.0.0
next-version: 3.0.0
branches:
master:
regex: main
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cake
# Cake

Cake (C# Make) is a build automation system with a C# DSL to do things like compiling code, copy files/folders, running unit tests, compress files and build NuGet packages.

Expand Down Expand Up @@ -95,7 +95,7 @@ For more information see the [.NET Foundation Code of Conduct](http://www.dotnet

## Contribution License Agreement

By signing the [CLA](https://cla.dotnetfoundation.org/cake-build/cake), the community is free to use your contribution to .NET Foundation projects.
By signing the [CLA](https://github.com/dotnet-foundation/.github/blob/main/CLA/dotnetfoundation.yml), the community is free to use your contribution to .NET Foundation projects.

## .NET Foundation

Expand Down
42 changes: 42 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
### New in 3.0.0 (Released 2022/11/08)

* 4046 Add typed data context CakeTaskBuilder.Finally overload.
* 4000 Remove obsolete CakeEngine Setup/Teardown events.
* 3997 Remove obsolete Logger property from DotNetTestSettings.
* 3991 Remove obsolete DotNetCore aliases.
* 3972 Remove .NET Core 3.1 TFM.
* 3969 Update Spectre.Console to 0.45.0.
* 3949 Remove .NET 5 TFM.
* 3946 Access to ITaskSetupContext in Frosting.
* 3867 Rename WindowsFact to WindowsFactAttribute to follow best practices.
* 3722 DotNetCore -> DotNet Rename Missed Objects.
* 4047 Add typed CakeTaskBuilder / TaskOf() to easier work with typed data context.
* 4028 Add GitLab CI SetEnvironmentVariable Command.
* 4019 Add support for TeamCity build status message.
* 4018 Add Support For TeamCity Statistics.
* 4011 Add GitHub Actions SetStepSummary Command.
* 4009 Add GitHub Actions SetOutputParameter Command.
* 3950 Add .NET 7 Support.
* 3328 Frosting: Support criteria description.
* 2863 Add support for GitHub Action workflow commands.
* 2470 Call multiple tasks from CLI and pass them to RunTarget.
* 1146 Add OutputDirectory property for Chocolatey Aliases.
* 4060 Update Microsoft.NETCore.Platforms to 7.0.0.
* 4059 Update System.Reflection.Metadata to 7.0.0.
* 4058 Update System.Collections.Immutable to 7.0.0.
* 4057 Update Microsoft.Extensions.DependencyInjection to 7.0.0.
* 4055 Add column to summary to include skip reason.
* 4052 Update Basic.Reference.Assemblies.* to 1.4.1.
* 4050 Overhaul Chocolatey Cake aliases.
* 4044 Overload missing for IsDependeeOf accepting a CakeTaskBuilder object.
* 4038 Add missing MSBuildSettings to DotNetRunSettings.
* 4036 Add missing MSBuildSettings to DotNetTestSettings.
* 4032 Add additional settings for ILMerge.
* 4020 Update Basic.Reference.Assemblies.* to 1.4.0.
* 4016 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.4.0-4.final.
* 4006 Add missing GitVersion command line options.
* 3124 EscapedBranchName is not supported by GitVersion.CommandLine.
* 4023 Update supported versions of Cake.
* 4034 DotNetMSBuildSettings ArgumentCustomization is not called with all DotNet* aliases.
* 4030 GitLab CI runner tags are not split correctly.

### New in 2.3.0 (Released 2022/10/14)

* 3947 Easier Way to Read Process Output?.
Expand Down
8 changes: 5 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

| Version | Supported |
| --------- | ------------------ |
| 1.0.x | :white_check_mark: |
| 0.38.5 | :white_check_mark: |
| 3.x.x | :white_check_mark: |
| 2.x.x | :white_check_mark: |
| 1.0.x | :x: |
| 0.38.5 | :x: |
| <= 0.38.4 | :x: |

## Reporting Security Issues
Expand Down Expand Up @@ -44,4 +46,4 @@ This information will help us triage your report more quickly.

## Preferred Languages

We prefer all communications to be in English.
We prefer all communications to be in English.
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ init:
build_script:
- ps: Invoke-RestMethod -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'
- ps: New-Item -Path .\.dotnet -ItemType Directory -Force | Out-Null
- ps: .\dotnet-install.ps1 -Channel 3.1 -InstallDir .\.dotnet
- ps: .\dotnet-install.ps1 -Channel 5.0 -InstallDir .\.dotnet
- ps: .\dotnet-install.ps1 -Channel 6.0 -InstallDir .\.dotnet
- ps: .\build.ps1 --target="AppVeyor"

# Tests
Expand Down
4 changes: 3 additions & 1 deletion bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Cake Bitbucket Pipeline
image: cakebuild/cake:2.1-sdk-mono
image: cakebuild/cake:sdk-7.0
clone:
depth: full

pipelines:
default:
Expand Down
11 changes: 5 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ Task("Run-Unit-Tests")
() => GetFiles("./src/**/*.Tests.csproj"),
(parameters, project, context) =>
{
foreach(var framework in new[] { "netcoreapp3.1", "net5.0", "net6.0" })
foreach(var framework in new[] { "net6.0", "net7.0" })
{
FilePath testResultsPath = MakeAbsolute(parameters.Paths.Directories.TestResults
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));
DotNetTest(project.FullPath, new DotNetTestSettings
{
Expand Down Expand Up @@ -390,9 +390,8 @@ Task("Run-Integration-Tests")
.DeferOnError()
.DoesForEach<BuildParameters, FilePath>(
parameters => new[] {
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/netcoreapp3.1/**/Cake.dll").Single(),
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net5.0/**/Cake.dll").Single(),
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net6.0/**/Cake.dll").Single()
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net6.0/**/Cake.dll").Single(),
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net7.0/**/Cake.dll").Single()
},
(parameters, cakeAssembly, context) =>
{
Expand All @@ -415,7 +414,7 @@ Task("Run-Integration-Tests")
.AppendSwitchQuoted("--multipleargs", "=", "b")
.AppendSwitchQuoted("--testAssemblyDirectoryPath", "=", cakeAssembly.GetDirectory().FullPath)
.AppendSwitchQuoted("--testAssemblyFilePath", "=", cakeAssembly.FullPath)
.AppendSwitchQuoted("--testDotNetCoreVerbosity", "=", "Diagnostic")
.AppendSwitchQuoted("--testDotNetVerbosity", "=", "Diagnostic")
.AppendSwitchQuoted("--testDotNetRollForward", "=", "LatestMajor")
});
}
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.402",
"version": "7.0.100",
"rollForward": "latestFeature"
}
}
3 changes: 2 additions & 1 deletion src/Cake.Cli/Cake.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<ItemGroup>
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="Spectre.Console" Version="0.44.0" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.45.0" />
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions src/Cake.Cli/Hosts/BuildScriptHost.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.Collections.Generic;
using System.Threading.Tasks;
using Cake.Core;
using Cake.Core.Diagnostics;
Expand Down Expand Up @@ -70,7 +71,21 @@ public override async Task<CakeReport> RunTargetAsync(string target)
{
Settings.SetTarget(target);

return await internalRunTargetAsync();
}

/// <inheritdoc/>
public override async Task<CakeReport> RunTargetsAsync(IEnumerable<string> targets)
{
Settings.SetTargets(targets);

return await internalRunTargetAsync();
}

private async Task<CakeReport> internalRunTargetAsync()
{
var report = await Engine.RunTargetAsync(_context, _executionStrategy, Settings).ConfigureAwait(false);

if (report != null && !report.IsEmpty)
{
_reportPrinter.Write(report);
Expand Down
19 changes: 16 additions & 3 deletions src/Cake.Cli/Hosts/DescriptionScriptHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ public DescriptionScriptHost(ICakeEngine engine, ICakeContext context, IConsole

/// <inheritdoc/>
public override Task<CakeReport> RunTargetAsync(string target)
{
PrintTaskDescriptions();

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}

/// <inheritdoc/>
public override Task<CakeReport> RunTargetsAsync(IEnumerable<string> targets)
{
PrintTaskDescriptions();

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}

private void PrintTaskDescriptions()
{
var maxTaskNameLength = 29;

Expand All @@ -56,8 +71,6 @@ public override Task<CakeReport> RunTargetAsync(string target)
{
_console.WriteLine(lineFormat, key, _descriptions[key]);
}

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Cake.Cli/Hosts/DryRunExecutionStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Task HandleErrorsAsync(Func<Exception, ICakeContext, Task> action, Except
return Task.CompletedTask;
}

public Task InvokeFinallyAsync(Func<Task> action)
public Task InvokeFinallyAsync(Func<ICakeContext, Task> action, ICakeContext context)
{
return Task.CompletedTask;
}
Expand Down
20 changes: 20 additions & 0 deletions src/Cake.Cli/Hosts/DryRunScriptHost.cs
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 System.Collections.Generic;
using System.Threading.Tasks;
using Cake.Core;
using Cake.Core.Diagnostics;
Expand Down Expand Up @@ -66,5 +67,24 @@ public override async Task<CakeReport> RunTargetAsync(string target)

return result;
}

/// <inheritdoc/>
public override async Task<CakeReport> RunTargetsAsync(IEnumerable<string> targets)
{
_log.Information("Performing dry run...");
_log.Information("Targets are: {0}", string.Join(", ", targets));
_log.Information(string.Empty);

Settings.SetTargets(targets);

var strategy = new DryRunExecutionStrategy(_log);
var result = await Engine.RunTargetAsync(Context, strategy, Settings).ConfigureAwait(false);

_log.Information(string.Empty);
_log.Information("This was a dry run.");
_log.Information("No tasks were actually executed.");

return result;
}
}
}
17 changes: 15 additions & 2 deletions src/Cake.Cli/Hosts/TreeScriptHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public TreeScriptHost(ICakeEngine engine, ICakeContext context, IConsole console

/// <inheritdoc/>
public override Task<CakeReport> RunTargetAsync(string target)
{
PrintTaskTree();

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}

/// <inheritdoc/>
public override Task<CakeReport> RunTargetsAsync(IEnumerable<string> targets)
{
PrintTaskTree();

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}

private void PrintTaskTree()
{
var topLevelTasks = GetTopLevelTasks();
_console.WriteLine();
Expand All @@ -46,8 +61,6 @@ public override Task<CakeReport> RunTargetAsync(string target)
PrintTask(task, string.Empty, false, 0);
_console.WriteLine();
}

return System.Threading.Tasks.Task.FromResult<CakeReport>(null);
}

private List<ICakeTaskInfo> GetTopLevelTasks()
Expand Down
Loading

0 comments on commit 7728438

Please sign in to comment.