Cake v1.0.0 RC1 released

Published
Thursday, 5 November 2020
Category
Release Notes
Author
devlead

Version 1.0.0-rc0001 of Cake has been released

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

Why Release Candidate?

We've chosen to release 1.0 as a pre-release to NuGet and Chocolatey, so we and the community can more easily test and ensure that our 1.0 release will be as stable as possible. It will also enable us to see if there are any steps you need to take to adapt your scripts for 1.0, and for us to see if there're any unintended breaking changes, by testing as many addins, modules, and recipes as possible.

Major new features

  • .NET 5 support
  • C# 9 support
  • Implicit bootstrapping
  • Rewritten CLI
  • Frosting incorporated into main repository
  • Improved globbing support
  • Improved documentation
  • Bugfixes, increased test coverage, and integration tests

Upgrading

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

.NET 5 Support

Cake 1.0 will fully support running natively under .NET 5 both with scripts using the .NET Tool Cake.Tool and as regular .NET Console applications using the Cake Frosting library.

C# 9 support

With .NET 5 and the latest version of Roslyn comes the full power of C# 9 to your build process. And if we may say so, records are brilliant for your build state.

public record StorageAccount(
    string Name,
    string Container,
    string Key
);

public record BuildData(
    string Version,
    DotNetCoreMSBuildSettings MSBuildSettings,
    StorageAccount StorageAccount
)
{
    public bool ShouldPublish { get; } = !string.IsNullOrEmpty(StorageAccount.Name)
                                            && !string.IsNullOrEmpty(StorageAccount.Container)
                                            && !string.IsNullOrEmpty(StorageAccount.Key);
}

Setup<BuildData>(context=>{
    var version = context.Argument("version", "1.0.0");

    return new (
        version,
        new DotNetCoreMSBuildSettings()
                                .WithProperty("Version", version)
                                .WithProperty("Configuration", context.Argument("configuration", "Release")),
        new (
            context.EnvironmentVariable("PUBLISH_STORAGE_ACCOUNT"),
            context.EnvironmentVariable("PUBLISH_STORAGE_CONTAINER"),
            context.EnvironmentVariable("PUBLISH_STORAGE_KEY")
        )
    );
});

Task("Build")
    .Does<BuildData>((context, data) => context.Information("Building {0}", data.Version));

RunTarget("Build");

Implicit bootstrapping

Boostrapping of Cake modules is now implicit, which means that you no longer will need to execute Cake twice to additionally download and initialize modules, just add the module directive to your script and this will be handled transparently for you.

#module nuget:?package=Cake.DotNetTool.Module&version=0.4.0

Rewritten CLI

We're now utilizing Spectre.Cli for a more robust, flexible and future proof handling of command line input.

Full details of everything that was included in this release can be seen below.

Frosting incorporated into main repository

Cake Frosting is now incorporated in the same GitHub repository as ( cake-build/cake ) all the other Cake runners, this means it'll be released and supported with the same cadence as them.

Supported platforms

Runner .NET 5 .NET 4.6.1 .NET Core 3.1 .NET Core 3.0 .NET Core 2.1 .NET Core 2.0 .NET Standard 2.0 Mono
.NET Tool
Cake Frosting
Cake runner for .NET Framework
Cake runner for .NET Core

Supported operating systems

Runner macOS Linux Windows
.NET Tool
Cake Frosting
Cake runner for .NET Framework
Cake runner for .NET Core

Supported CI Systems

Runner AppVeyor Azure Pipelines Bamboo Bitbucket Pipelines Bitrise Continua CI GitHub Actions GitLab CI GoCD Jenkins MyGet TeamCity TravisCI
.NET Tool
Cake Frosting
Cake runner for .NET Framework
Cake runner for .NET Core

How can you help?

Help us by taking Cake 1.0.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 1.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

Contributions were included from:

Issues

As part of this release we had 48 issues closed.

Breaking change

  • #2292 Remove obsolete methods and properties.
  • #2333 RFC-0001: Rewrite Cake CLI.

Feature

  • #2874 Merge frosting into main Cake repo.
  • #2883 (Frosting) Add support for .NET 5.
  • #2857 Add support for .NET 5.
  • #2776 Checklist for 1.0.
  • #2755 Add DirectoryHashCalculator.
  • #2199 Add GlobPattern class.
  • #741 Add IsRunningOnMacOs() alias.

Improvement

  • #2913 Add overload for DotNetCoreRun.
  • #2908 Future proof .NET [Core] detection.
  • #2897 Add tests for MyGetProvider.
  • #2895 Custom contexts should inherit from CakeContextAdapter.
  • #2877 Add NuGet's Icon setting to NuGetPackSettings.
  • #2870 Add helpers for adding multiple strings to ProcessArgumentBuilder.
  • #2866 Support multiple dotnet test options.
  • #2847 Add new GitHub Actions URL environment variables.
  • #2844 Add missing dotnet test options.
  • #2839 Add support for PublishReadyToRunShowWarnings property in DotNetCorePublish.
  • #2833 Implicit bootstrapping of modules.
  • #2831 ParseAssemblyInfo does not detect lines with extra spaces.
  • #2825 Add option to ignore tool exit code.
  • #2822 Add support of ReportGenerator global tool.
  • #2820 Add DebuggerStepThroughAttribute to generated code.
  • #2817 Bump dependencies.
  • #2801 Inconsistent NuGet file name case.
  • #2792 Add dotnet nologo options.
  • #2743 Tool resolution for multiple names should be breadth first.
  • #2703 OpenCover is missing hideskipped setting.
  • #2623 DotNetCoreTestSettings Can Have Multiple Logger's.
  • #2595 Misleading output message when trying to install prerelease package with the in-process nuget installer.

Documentation

  • #2925 Fix sentences which end with double full stop.
  • #2918 Incorrect link for ReSharper's Open Source webpage in Cake readme.
  • #2894 Remove unnecessary documentation and replace it with .
  • #2879 Update links pointing to cakebuild.net to new URL structure.
  • #2836 Update README with more up-to-date "getting started" information.
  • #2811 Identity of BuildProblem in TeamCityProvider should be optional.

Build

  • #2920 Bump Cake script dependencies.
  • #2899 Update to .NET 5 SDK RC 2.
  • #2850 Bump .NET Core SDK to 3.1.402.
  • #2818 Start producing 1.0.0-rc0001 NuGet Packages.
  • #2814 Switch GRM to not mark GitHub release as a pre-release.
  • #2781 Bump StyleCop to latest version.

Bug

  • #2911 C# syntax errors in exceptions causes Specre.CLI internal error.
  • #2861 Fix error output in 1.0 preview.
  • #2853 Custom argument names are not case insensitive in 1.0 preview.
  • #2887 (Frosting) Fix line endings in build.sh within template package.
  • #2734 Can't resolve resource assemblies.