Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



2 answers

Permanent link
 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

1 vote


Permanent link

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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,121
× 343
× 76
× 63

Question asked: Apr 08 '14, 11:32 a.m.

Question was seen: 5,500 times

Last updated: Apr 15 '14, 3:52 a.m.

Confirmation Cancel Confirm