views:

285

answers:

2

Following on from this question, I now want to know how to stop an ANT script from executing if the preceding build failed. I can't see a way in the Build setup in Eclipse of chaining builds together based on their success.

I think I am lookikng for either a way to pass the previous build status into my ANT script so I can terminate or to never call the ANT script at all if the first build fails.

Any ideas?

A: 

You should be able to store the success into a file. If you make sure the content of the file is a property file content the next ant task can use that file to fill in a property (like build.success) and can act on that.

lothar
+1  A: 

No native way, AFAIK. What you can do is modify your ant script to check if .class files produced by Eclipse are newer than WAR. If not, stop.

Yoni Roit
I was thinking along these lines myself. Looks like I need to learn a bit more ANT...
Simon