Cake script aliases

Cake supports something called script aliases. Script aliases are convenience methods that are easily accessible directly from a Cake script. Every API method in Cake is implemented like this.

In this blog post I will show how to extend Cake with your own script aliases. It's really simple, I promise. ;-)

Read more...

It's not a party without Cake

I have during my nine years as a (professional) programmer used several different build automation systems such as Rake, psake, CMake, TFS Build and FAKE, but none of these have allowed me to write my build scripts using C# - the language I use the most.

About two months ago I decided to change that and now it's time to formally introduce Cake, which is short for C# Make.

Read more...

The singleton logger

It is widely accepted that you access logging frameworks via a static singleton instance, and most logging frameworks are designed to work like this. But why? Many people often refer to it as being a cross-cross cutting concern; and that it's therefore not important to do things by the book. Not only does most logging frameworks use the static singleton as a fa├žade, but they also store process-wide state.

Read more...

Introducing Lunt

Last summer, a friend and I started to write a little Paradroid clone. Since my only real experience as a game programmer was with XNA and MonoGame, I had grown fond of the XNA Content Pipeline, and naturally wanted something similar for this project.

The game was going to be cross platform (Windows and Linux) so the asset pipeline had to be cross platform as well. The natural step was therefore to see if the MonoGame Content Builder (MGCB for short) could be used for this.

Read more...

Displaying TeamCity build status on GitHub

Have you ever wanted to display the current CI build status for a TeamCity project in your GitHub README? I did but couldn't find any good, straight forward information about how to do it. Turns out it's quite simple.

Read more...

System.IO.BinaryWriter and C++

A while back I had to read string data written by .NET's BinaryWriter in C++. I was initially a little bit confused about how the data was written but after using Reflector it turned out that the write method prefixes the string with a 7-bit encoded integer.

Read more...

Culture agnostic string comparisons

Something I've seen a lot at different clients is naive string comparison. The most common case is to do something involving String.ToLower() on both strings that are being compared and then an equality comparison of the result.

Read more...

How to dynamically add attributes to a class with Castle.Core

Yesterday I was working on some unit tests that ensured that some user derived classes passed to a method were decorated with a specific attribute.

Read more...