I think the error code of the program <exec>'ed can now be captured with ANT 1.5beta... Check it out. --DD
-----Original Message----- From: Neal Myerson [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 1:47 PM To: [EMAIL PROTECTED] Subject: How do I force ant to fail? Summary: I'm trying to write some checkin tests using Ant. They use jdk14, so I do a simple recusion to make sure JAVA_HOME is set properly. if="jdk1.4", I then run the tests with a simple: <java classname="jbtest.JBTestRunner" fork="yes" failonerror="true"> .... </java> Works great. When the tests fail, I get a BUILD FAILED from Ant, just like I want! Except... to set jdk1.4 I had called: <exec executable="${antexec}" dir="." failonerror="true"> <env key="JAVA_HOME" value="../build/jdk1.4"/> <arg value="${targetName}"/> </exec> And this I cannot get to fail. So even when the nested Ant script fails, this one still succeeds, even though I have a failonerror set. I assume it's because the exec actually does succeed, it's just the ant script that was called from it that failed. Does this make sense? How can I get the outer Ant script to fail. Or more to the point, when my tests fail I want total system failure. I want it to say BUILD FAILED and just stop. Any ideas? Thanks -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
