James Crisp

Software dev, tech, mind hacks and the occasional personal bit

Category: EDI

Green & Red Local Builds (adding colour to the local build process)

build.JPGWell, who doesn’t write tests and do continuous integration (CI) these days? Whether you use one of the many Cruise Control variants, or Team City or some other tool, you most likely get a handy colour coding of builds as either green or red (ie, good, or bad). But, you can take this a step further!

redbuild.JPGOften on .NET projects, we have a little batch file that we run before checking in (often with a pause at the end so it can be run from a shortcut), to confirm that no tests are broken locally. Well, it’s not much fun peering at the ugly Nant output (or whatever build system you use). Instead, it is quite easy to add a couple of lines to your batch file and change the colour of the console to bright Red or bright Green depending on the success of the local build. It is great for telling what the result was at a glance. I can’t claim credit the idea – it was something we used at EDI for our custom build system, but here’s some batch file code I whipped up which I can claim is all mine, every last GOTO of it! Enjoy 🙂

The following code uses NAnt, but you can replace it with MsBuild or any other build tool that returns a status code.

@echo off

color 07

tools\\nant\\NAnt.exe -buildfile:mybuild.build %*

IF ERRORLEVEL 1 goto RedBuild
IF ERRORLEVEL 0 goto GreenBuild

:RedBuild
color 4F
goto TheEnd

:GreenBuild
color 2F

:TheEnd
pause

Bye Bye EDI… Hello ThoughtWorks

Well, after almost four years at EDI (now called CargoWise edi) I am leaving. I finish in the middle of January next year. It has been an interesting time, and I have learnt a lot working with very talented people and from building the framework for a big solution suite (around 4 million lines of C# code). I’ve also had the opportunity to experience the very different joys and pitfalls of product management.

I will be starting at ThoughtWorks (of NUnit, Jim Webber and Martin Fowler fame) in the middle of February in the new year. I’m expecting that there will be a lot of new exciting stuff to learn, and a lot of variety in terms of clients and technologies. ThoughtWorks are strongly XP, do a lot of development on client sites and even have some Rails projects. The people I have met from ThoughtWorks have all been very friendly and I look forward to starting there soon 🙂

Powered by WordPress & Theme by Anders Norén