Fail Build from ANT?
Hi there!
Firstly thanks for all the great contributions on here its been a great help.
I am running a JBE command line build, running a batch script. The batch script compiles my code using a makefile and have been using ANT to monitor the progress. I start several build activities for each stage and finish them when the batch script moves on. So far that has been fine. I have even been able to get my cppunit results published.
The problem is that if the build fails completely e.g my files don't even compile, RTC still reports it as having completed (just stopping at one of the activities such as compiling a certain file) . I was wondering if there was any way to get the ANT script to tell Jazz to fail the build if any tasks haven't completed?
I had a look at http://www-01.ibm.com/support/docview.wss?uid=swg21610613 but as I'm running a makefile (ssh'ing to linux from windows to remote compile) I want to stay away from encapsulating everything in an ANT script. Is there any other way to report the logStatus as ERROR owing to the fact that some activities were not completed?
This might be a bit unclear! I will happily clarify if anyone can help?
Thanks in advance
2 answers
Hi,
Thanks for the response. What I've ended up doing is something like this (From my batch script)
set RETVAL=%ERRORLEVEL%
if not["%RETVAL%"]==["0"]
%antCall% -DactivityLabel="Compiling.." -Dstatus=ERROR -DcomponentName=%PROJECT_COMPONENT% logPublisher
I assume that's what you meant? It works either way and the build fails on the environment error level from the remote build call.
Thanks
Guy