ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donal Quinlan <>
Subject Re: exit code
Date Tue, 15 Apr 2003 20:46:34 GMT
I want to avoid using <exec> because of all the os issues it will cause.
However I successfully grafted the resultproperty code from and put it into a custom java task (which was a copy of This worked like a dream.

    <taskdef name="resultjava"
      <resultjava classname="com.installshield.isje.ISJE" fork="true" 
            dir="${mp50.dir}" jvm="${mp50.jvm}">

      <condition property="">
          <equals arg1="${exitcode}" arg2="0" />
          <equals arg1="${exitcode}" arg2="-1" />
      <fail unless="${}"
            message="More than just warnings occurred when building 
MultiPlatform installer, exitcode = ${exitcode}"/>

This was so simple to add, I think it should be made part of the normal 
<java> task. I would be willing to do it (because it's simple :-)  )

Alternatively I can email the custom class if somebody else would find 
it useful.



PS. Like the book Steve (and Erik). It has been a life saver on more 
than one occassion. Now would that be you or Erik posing on the cover? ;-)

Steve Loughran wrote:

> Donal Quinlan wrote:
>> We have had failonerror set to false for a long time. What we want to 
>> do now is make the build fail if the exit code is anything other than 
>> 0 or -1. Any ideas? I know how to do this if I can capture the exit 
>> code, but I do not know how to capture the exit code. We are using 
>> ant 1.5.2
> There is some attribute of <exec> that lets you name a property to 
> stick the exit code in, your test is simply a <condition> and then a 
> <fail> from that...
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message