It's all about the answers!

Ask a question

Fail Build from ANT?


Guy Sleigh (623) | asked Apr 08 '14, 11:32 a.m.
edited Apr 15 '14, 3:52 a.m. by Krzysztof Kaźmierczyk (7.5k480103)

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



permanent link
Spencer Murata (2.3k115971) | answered Apr 08 '14, 1:34 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 The activity approach won't work for this since the activities are just marking progress through the build.  To fail the overall build you would need to contribute the failing compilation results with the status of error.  That should fail the build overall.

~Spencer

permanent link
Guy Sleigh (623) | answered Apr 09 '14, 9:43 a.m.

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

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.