DC has absolutely no knowledge of what the build command it executes actually does. It just launches the command you tell it to launch. (Could be notepad.exe or gimp for that matter - try it!). Since the build command is an arbitrary command, there might not even be any (system err/system out) output from it, so DC doesn't try to parse that output. (Although it pipes it to a log file which you can browse to from the web admin).
What DC does is quite old fashioned (yet a well-established paradigm, at least in unix land): It looks at the return code from the build command. If it's 0 it is OK, otherwise it is KO. In short this means that your build command (whatever it is) must make sure to return a non-0 return code in the event of a build failure. Ant, Maven and Make do that.
If you are writing a your build script in shell-script or some other scripting languages like Python and Ruby you need to make sure you are exiting with a non-zero exit code on build failure. Have a look at ant.bat to see how to do it from a .bat script.
For example, the DamageControl build scripts (written in ruby and which of course are built in DamageControl itself) have code that looks something like this:
def fail(message = $?.to_s) puts "BUILD FAILED: #{message}" exit!(1) # <------ non-zero exit code, build failed! end def run(args) begin # ... snip, run the build ... rescue Exception => e fail(e.message) end puts "BUILD SUCCESSFUL" # exits with exit code zero end
Under UNIX, the exit status of a shell script is the same as the last command run, which is generally what you want.
Under Windows, you may have to add exit %errorlevel% to the end of your batch file.

Comments (1)
Nov 24, 2004
Anonymous says:
I'm trying to use DC, but ant doesn't seem to return a nonzero return code... an...I'm trying to use DC, but ant doesn't seem to return a non-zero return code... any idea why? I followed the instructions and entered the build command as "cmd /C ant ..."