Cake!... Baking a new Build with C# Make
I've been automating a number of builds recently. And like in the past, I have to learn a language and process. While the new Build system in TFS 2015/VSTS is awesome and so much nicer than past Builds offerings (aka XAML Build and Build v1), I'm still learning something new.
My apps are built with C#, why can't my Build be C# too?
It can! C# Make, better known as Cake is now available! It's cross VCS (TFS, VSTS, TeamCity, Jenkins, etc.), cross platform (Windows, OS X,, Linux) and free & OSS...
Adds support for the Cake build tool in Visual Studio 2015. Includes support for the Task Runner Explorer, new item and project templates and bootstrapping important Cake files
Originally based off Mads Kristensen's Brunch Task Runner extension.
In order to use this extension, you must have Cake installed on your machine or in your solution.
Use chocolatey to install it globally by typing the following in an elevated command prompt:
choco install -y cake.portable
Alternatively, if you have run the bootstrapper at least once, Visual Studio should automatically discover it (see below).
The Cake Task Runner automatically triggers when it finds a
Task Runner Explorer
Open Task Runner Explorer by right-clicking the Cake script and select Task Runner Explorer from the context menu:
Choose Cake Build from the Build menu to quickly install the default bootstrapper scripts or Cake configuration files into your solution.
The extension includes an item template for build scripts and project templates for Cake modules, addins, and unit tests.
What is Cake?
Cake (C# Make) is a cross platform 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.
Cake is built on top of the Roslyn and Mono compiler which enables you to write your build scripts in C#.
Cake is available on Windows, Linux and OS X.
Regardless if you're building on your own machine, or building on a CI system such as AppVeyor, TeamCity, TFS, VSTS or Jenkins, Cake is built to behave in the same way.
Cake supports the most common tools used during builds such as MSBuild, MSTest, xUnit, NUnit, NuGet, ILMerge, WiX and SignTool out of the box.
We believe in open source and so should you. The source code for Cake is hosted on GitHub and includes everything needed to build it yourself.
Cake 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.
Cake uses a dependency based programming model just like Rake, FAKE and similar build automation systems where you declare tasks and the dependencies between those.
- Build systems
- Continua CI
- AssemblyInfo patching
- Release notes parsing
- Unit Test Runners
- xUnit (v1 and v2)
- Octopus Deploy
- Compression (Zip)
- File hash calculation (MD5, SHA256, SHA512)
Cake also contains functionality to conveniently work with file system paths as well as performing common file/directory/environment operations, manipulating XML, parsing Visual Studio solutions, starting processes and more.
[Insert lame joke about getting started baking now...]