Who Wants Cake?!


I’ve been learning and trying out new build systems in .NET recently and decided to give Cake a sample. (See what I did there?)

First Impressions

Right away I liked how the scripts look and feel. This is quite important to me and one of the reasons I dislike scripting things in Powershell. Powershell is more difficult for me to read and understand than I would like. I believe it’s largely due to the common coding styles, but that’s my problem.

Here’s a sample script:

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var buildDir = Directory("./src/Example/bin") + Directory(configuration);

Task("Clean")
  .Does(() => {
    CleanDirectory(buildDir);
});

Task("Restore-NuGet-Packages")
  .IsDependentOn("Clean")
  .Does(() => {
    NuGetRestore("./src/Example.sln");
});

Task("Build")
  .IsDependentOn("Restore-NuGet-Packages")
  .Does(() => {
    MSBuild("./src/Example.sln", settings =>
      settings.SetConfiguration(configuration));
});

Task("Default")
  .IsDependentOn("Build");

RunTarget(target);

To me (and possibly because I write C# nearly every day) this is very readable and nice to look at.

Tools

There are loads of tools out of the box, but a couple more that I needed. I was able to get Fixie into the v0.5.0 release, so that was nice. The other is RoundhousE, which should be coming soon!

Contributing

Many Kudos to Patrik for maintaining a very clean and intuitive codebase! Everything is well thought out, in the right place, and easy to understand and follow. If you want to fix a bug or add a feature to this project, it won’t be hard. In fact, it will probably be a pleasure! Additionally, the issues on GitHub are a great place to ask questions, request features, or submit bugs. You’ll likely get a response from Patrik or somebody else the same day; as a maintainer of other open source projects, I wish I was that good.

All of these reasons make this a very nice project to work on if you’re looking to get more into open source. There are even some Up For Grabs Cake issues you could work on today!

Happy 10th Birthday Git!