Cake v2.0.0 RC 1 released

Published
07 November 2021
Category
Release Notes
Author
Pascal Berger

Version 2.0.0 RC 1 of Cake has been released. Take it for a spin and give us feedback on our discussion board.

This is the first pre-release of Cake 2.0🎉 In this blog post, we will go through some of the major new features of 2.0, which platforms are supported, and how you can help to get Cake 2.0 released.

Highlights of this release

... and more! The full list of changes is listed below.

Upgrading

See Upgrade instructions for documentation about breaking changes in this release.

Supported runners and required .NET version

To allow Cake to make use of modern platform features, make life easier for extension authors and simplify decision process of users we have decided to stop shipping Cake runner for .NET Framework and the already deprecated Cake runner for .NET Core with 2.0. Additionally we dropped support to run on .NET Core 2.1 and .NET Core 3.0 for Cake .NET Tool and Cake Frosting.

This means that, starting with Cake 2.0, you will need to have the .NET SDK installed on your build machine, at a minimum .NET Core 3.1, but .NET 6 is recommended, in order to run Cake. In other words, Cake itself will no longer run on .NET Framework, Mono and .NET Core 3.0 or older. Cake will continue to support building of .NET Framework projects as well as projects targeting .NET Core 3.0 or older.

Supported platform matrix for Cake 2.0 will look like this:

Runner .NET 6 .NET 5 .NET Core 3.1
Cake .NET Tool
Cake Frosting

As a consequence of no longer shipping Cake runner for .NET Framework we will also stop shipping the Cake.Portable Chocolatey package and Homebrew Cake formulae.

Cake runner for .NET Core has been deprecated since version 1.0 with Cake .NET Tool as the suggested replacement. For users of Cake runner for .NET Framework it is also suggested to switch to Cake .NET Tool and run builds on .NET Core 3.1 or newer. For users which rely on an extension, or other dependencies, which require .NET Framework or .NET Core 3.0 or older, suggestion is to stay on Cake 1.x.

See Sunsetting of .NET Framework and .NET Core runners in Cake 2.0 for details.

Improvements to aliases for dotnet

Cake 1.x had many DotNetCore*** aliases for executing dotnet such as DotNetCoreBuild, DotNetCoreTest, etc. The Core part in the name existed for historical reasons when .NET Core was first introduced and lasted until v3.1. With .NET 5, Microsoft dropped the "Core" from the name, and Cake 2.0 follows this naming schema for its .NET aliases: DotNetCoreBuild becomes DotNetBuild, DotNetCoreTest becomes DotNetTest, etc.

Note that the old aliases are still available but deprecated and will be removed in Cake 3.0.

See #3341 for details.

Improved GitHub Actions integration

Cake 2.0 comes with a few improvements to the GitHub Actions build provider:

  • Properties of files and paths are now of type FilePath and DirectoryPath
  • New Environment properties which returns runtime info, runner name and workflow action path
  • UploadArtifact command to upload a local directory or file into a file container folder and create an artifact.
  • SetEnvironmentVariable command to create or update an environment variable for any steps running next in a job.
  • AddPath command to add a directory to the system PATH variable and automatically make it available to all subsequent actions in the current job.

Improved Azure Pipelines integration

Cake 2.0 comes with a few improvements to the Azure Pipelines build provider. See Azure Pipelines build provider updates for details.

We've now set the recommended version of Cake.Core for addins to target to 2.0.

This won't break the build but you might see warnings like below when addins or modules are loaded.

The assembly 'Cake.FileHelpers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (1.0.0).

How can you help?

Help us by taking Cake 2.0 RC 1 for spin, test your scripts, addins and modules, if you have have questions please raise them on our GitHub Discussions and report any issues on our GitHub Issues.

Easiest and safest way to test is by using .NET Tool with a local tool manifest.

dotnet new tool-manifest
dotnet tool install Cake.Tool --version 2.0.0-rc0001

Then Cake will be available only in that folder where you created the manifest and not interfere with any other of your Cake projects.

dotnet cake build.cake

Contributors

This release was made possible thanks to the contribution of these awesome members of the Cake community along with Cake team:

Issues

As part of this release we had 65 issues closed.

Breaking changes

  • #3654 IsRunningOnAzurePipelines should ignore agent type (@pascalberger)
  • #3631 Refactor GitHub Actions Paths (@devlead)
  • #3610 Remove TFBuildProvider (@pascalberger)
  • #3590 Directories in AzurePipelinesBuildInfo are FilePaths - FilePath.GetDirectory then inconsistent (@devlead)
  • #3581 Stop shipping Cake.Portable Chocolatey package and Cake Homebrew formulae (@devlead)
  • #3579 Stop shipping Cake runner for .NET Framework and Cake runner for .NET Core (@devlead)
  • #3577 Remove ReverseDependencyAttribute (@pascalberger)
  • #3572 Only build for TargetFrameworks netcoreapp3.1, net5.0 and net6.0 (@devlead)
  • #3282 GitVersion Tool: Rename verbosity values to match GitVersion values (@joshuacookdev)
  • #3222 Add Xamarin.iOS platform targets to MSBuildSettings PlatformTarget enumeration (@Marusyk)
  • #3151 Add support for Engine event hooks after execution as well as before (@BlythMeister)
  • #3003 Remove DependencyAttribute (@pascalberger)
  • #2872 Bump eol target frameworks (@gitfool)
  • #2788 Tool:OpenCover - the register-setting should be an option, rather than a string (@nils-a)
  • #1111 DotNetCoreRestore: dotnet restore no longer supports globbing (@augustoproiete, @RLittlesII)

New Features

  • #3341 Introduce DotNet aliases (synonyms to DotNetCore aliases (@augustoproiete)
  • #3627 Add GitHub Actions AddPath Command (@devlead)
  • #3628 Add GitHub Actions SetEnvironmentVariable Command (@devlead)
  • #3629 Add GitHub Actions UploadArtifact Command (@devlead)
  • #3630 Add GitHub Actions Environment properties (@devlead)

Improvements

  • #3662 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.0.0-6.final (@devlead)
  • #3647 Display message of criteria when task fails to run due to criteria not being met (@augustoproiete)
  • #3644 Add DotNetNuGetUpdateSource aliases (synonym to DotNetCoreNuGetUpdateSource) (@augustoproiete)
  • #3643 Add DotNetNuGetRemoveSource aliases (synonym to DotNetCoreNuGetRemoveSource) (@augustoproiete)
  • #3642 Add DotNetNuGetListSourceSettings (derived from to DotNetNuGetSource) (@augustoproiete)
  • #3641 Add DotNetNuGetHasSource aliases (synonym to DotNetCoreNuGetHasSource) (@augustoproiete)
  • #3640 Add DotNetNuGetEnableSource aliases (synonym to DotNetCoreNuGetEnableSource) (@augustoproiete)
  • #3639 Add DotNetNuGetDisableSource aliases (synonym to DotNetCoreNuGetDisableSource) (@augustoproiete)
  • #3607 Add EnableCompressionInSingleFile to DotNetCorePublishSettings (@SIkebe)
  • #3599 Add VS2022 to default MSBuild Resolver (@devlead)
  • #3598 Remove Preview from VS2022 MSBuild Resolver (@devlead)
  • #3595 Update Autofac to 6.3.0 (@devlead)
  • #3593 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.0.0-5.final (@devlead)
  • #3591 Update Microsoft.NETCore.Platforms to 6.0.0-rc.2.21480.5 (@devlead)
  • #3555 Add DotNetNuGetAddSource aliases (synonym to DotNetCoreNuGetAddSource) (@augustoproiete)
  • #3554 Add DotNetNuGetDelete aliases (synonym to DotNetCoreNuGetDelete) (@augustoproiete)
  • #3553 Add DotNetNuGetPush aliases (synonym to DotNetCoreNuGetPush) (@augustoproiete)
  • #3552 Add DotNetPack alias (synonym to DotNetCorePack) (@augustoproiete)
  • #3551 Add DotNetPublish alias (synonym to DotNetCorePublish) (@augustoproiete)
  • #3550 Add DotNetVSTest alias (synonym to DotNetCoreVSTest) (@augustoproiete)
  • #3549 Add DotNetTest alias (synonym to DotNetCoreTest) (@augustoproiete)
  • #3548 Add DotNetBuildServer alias (synonym to DotNetCoreBuildServer) (@augustoproiete)
  • #3547 Add DotNetBuild alias (synonym to DotNetCoreBuild) (@augustoproiete)
  • #3546 Add DotNetRestore alias (synonym to DotNetCoreRestore) (@augustoproiete)
  • #3545 Add DotNetClean alias (synonym to DotNetCoreClean) (@augustoproiete)
  • #3544 Add DotNetExecute alias (synonym to DotNetCoreExecute) (@augustoproiete)
  • #3543 Add DotNetRun alias (synonym to DotNetCoreRun) (@augustoproiete)
  • #3542 Add DotNetTool alias (synonym to DotNetCoreTool) (@augustoproiete)
  • #3523 Add DotNetMSBuild alias (synonym to DotNetCoreMSBuild) (@augustoproiete)
  • #3215 Add RunCommand with postAction parameter to DotNetCoreTool (@jenscski)
  • #3075 Make FilePath and DirectoryPath comparable by value (@franciscomoloureiro)
  • #2571 OctopusDeploy DeployTo property to take collection of string to specify multiple environments (@nckl)
  • #2075 Add overloads for DotNetCore*() methods taking FilePath instead of string (@dharillo)
  • #1794 Private is missing from ProjectReference (@franciscomoloureiro)
  • #1616 Error message on circular references leads to poor developer experience (@norpache)

Bug Fixes

  • #1669 Release notes does not tolerate prerelease versions (@sgronlund, @ManasviGoyal)
  • #2443 Erroneous "Target path must be an absolute path" when preserveFolderStructure is used with CopyFiles (@ToMee99)

Documentation

  • #3602 Switch to Cake.Tool as primary package in REAME.md (@devlead)