- Published
- Sunday, 7 February 2021
- Category
- Release Notes
- Author
- devlead
Version 1.0.0 of Cake has been released.
This version is the 112th release of Cake, but just not any release - we've finally hit 1.0 🎉 In this blog post, we will go through some of the major new features of 1.0, which platforms are supported, what to consider when upgrading to Cake 1.0.
It's been an amazing journey so far - a journey that wouldn't have been possible without our amazing community, so huge thanks to you all!❤
Major new features
- .NET 5 support
- C# 9 support
- Implicit bootstrapping
- Rewritten CLI
- Frosting incorporated into main repository
- Frosting CLI brought up to speed with Cake script runners
- Improved globbing support
- Greatly 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 fully supports 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 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
Addin recommended Cake version set to 1.0
We've now set the recommended version of Cake.Core for addins to target to 1.0.
This won't break the build but you might see warnings like below when Addins/Modules are loaded.
The assembly 'Cake.DotNetTool.Module, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.33.0).
Rewritten CLI
We're now utilizing Spectre.Console 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.
Breaking changes in Cake Frosting
In this release the UseTool
extension has been renamed to InstallTool
.
In our prior release candidate we also noted that CakeHostBuilder
has been removed and CakeHost
can be used directly.
With Cake.Frosting 0.38.x:
// Create the host.
var host =
new CakeHostBuilder()
.WithArguments(args)
.UseStartup<Program>()
.UseTool(new Uri("nuget:?package=ReportGenerator&version=4.8.1"))
.Build();
// Run the host.
return host.Run();
With Cake.Frosting 1.0:
// Create and run the host.
return
new CakeHost()
.UseContext<BuildContext>()
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.1"))
.Run(args);
Supported operating systems
The following table shows the supported operating systems for each runner.
Runner | Windows | macOS | Linux |
---|---|---|---|
Cake .NET Tool | |||
Cake Frosting | |||
Cake runner for .NET Framework | [2] | [2] | |
Cake runner for .NET Core |
[2]: Requiring Mono 5.0.12 or newer
Supported platforms
The following table shows the supported platforms for each runner.
Note that the platform under which a build is running doesn't limit its build capabilities. It's absolutely possible to build a .NET Framework application with Cake running on .NET 5 / .NET Core or vice-versa.
Runner | .NET 5 | .NET Core 3.1 | .NET Core 3.0 | .NET Core 2.1 | .NET Core 2.0 | .NET Framework 4.6.1 or newer | Mono 5.0.12 or newer |
---|---|---|---|---|---|---|---|
Cake .NET Tool | |||||||
Cake Frosting | |||||||
Cake runner for .NET Framework | |||||||
Cake runner for .NET Core |
Supported Build Systems
The following table shows build systems for which Cake provides specific integrations.
Cake can run on any build system, even if not included in this list. For the listed build systems Cake provides out of the box integrations. See Build Systems for details.
Runner | AppVeyor | Azure Pipelines | Bamboo | Bitbucket Pipelines | Bitrise | Continua CI | GitHub Actions | GitLab CI | GoCD | Jenkins | MyGet | TeamCity | TravisCI |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cake .NET Tool | |||||||||||||
Cake Frosting | |||||||||||||
Cake runner for .NET Framework | |||||||||||||
Cake runner for .NET Core |
Contributions were included from:
- devlead
- gep13
- gitfool
- augustoproiete
- mholo65
- patriksvensson
- Aditya Shrotri
- mattleibow
- eoehen
- daveMueller
- flcdrg
- pascalberger
- mderriey
- Meir Blachman
- Roemer
- duracellko
- Marusyk
- xforever1313
- MrCull
- agc93
- VSerykh
Full details of everything that was included in this release can be seen below.
Issues
As part of this release we had 76 issues closed.
Breaking change
- #3050 Frosting: Rename CakeHost extension from UseTool to InstallTool.
- #2930 Increase potential breaking change property.
- #2333 RFC-0001: Rewrite Cake CLI.
- #2292 Remove obsolete methods and properties.
Feature
- #3020 Migrate to Spectre.Console.
- #2933 Enable NuGet provider in Frosting.
- #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
- #3083 Update --tree usage example to match option in the help info.
- #3069 Don't promote UseWorkingDirectory in Frosting default template.
- #3029 Add ICakeArguments.GetArgument extension.
- #3018 Cake displays raw ANSI output after running specific executables.
- #3009 Make Cake Core CakeDataService Public.
- #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.
- #2838 Add MakeRelative alias to DirectoryPath and FilePath.
- #2833 Implicit bootstrapping of modules.
- #2831 ParseAssemblyInfo does not detect lines with extra spaces.
- #2886 (Frosting) Support all commands that Cake does.
- #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.
- #2892 (Frosting) Add ANSI console.
- #2893 (Frosting) Align command line parsing with Cake.
Documentation
- #2962 Document breaking changes in 1.0 CLI.
- #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.
- #1690 Casing causes 'More than one build script specified.' message.
Bug
- #3077 Regression: rc0003 outputs extra characters on OSX.
- #3072 Attribute
[IsDependeeOf]
doesn't work. - #3038 Tool resolving in Frosting tasks.
- #3032 Frosting project fails on Linux.
- #3007 Different arguments between script runner and Frosting.
- #2963 EndOfStreamException thrown when using loaddependencies=true.
- #2961 Update dotnet cake usage instructions (dotnet cake --help).
- #2956 Wrong Cake version in build.config.
- #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.
- #2066 cake.coreclr help information error.
Build
- #2980 Update to .NET 5 SDK 5.0.101.
- #2929 GitReleaseManager milestone should use SemVersion.
- #2928 Cake.Frosting and Cake.Frosting.Template not pushed to NuGet.
- #2920 Bump Cake script dependencies.
- #2900 Update to .NET 5 SDK "RTM".
- #2899 Update to .NET 5 SDK RC 2.
- #2850 Bump .NET Core SDK to 3.1.402.
- #2818 Start producing 1.0.0 NuGet Packages.
- #2814 Switch GRM to not mark GitHub release as a pre-release.
- #2781 Bump StyleCop to latest version.