One of the great things about using CruiseControl.NET is its ability to run any executable as part of a build process, which is done by utilizing the Executable Task wherever needed in a build script. As handy as this is, there is an issue in that up through version 1.3, if the exit code from running the executable was not zero, CC.NET would fail the build. In most cases, this was expected behavior and a non-issue; however, there are some executables where an exit code other than zero might not mean success, but might not mean failure either.

A prime example is FxCop, specifically FxCop's command-line executable FxCopCmd.exe, which has several exit codes, some of which you might not want to consider fatal enough to break a build. Of course FxCopCmd.exe returns 0 for no errors, but it also returns 1 for analysis errors and 2 for rule exceptions, both of which are probably exit codes you can ignore.

But even if you wanted to ignore exit codes other than 0 you couldn't because CC.NET didn't allow you to - until now with version 1.4. With the latest version, the Executable Task now includes a <successExitCodes> node that allows you to specify a list of exit codes that indicate success. So for the above FxCopCmd.exe exit codes, we can now do this: <successExitCodes>0,1,2</successExitCodes>.

I upgraded our build server to 1.4 last week (using the latest build from ccnetlive) to take advantage of this new feature and all has been well. But if using one of those builds scares you, you'll be happy to know that yesterday the official release candidate was announced. And it's about time too because 1.3 was released almost a full year ago, so this update is welcome news. Enjoy.

Post your comment

Comment