ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: exit code
Date Tue, 15 Apr 2003 20:34:16 GMT
At 01:17 PM 4/15/2003 -0700, you 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...
>

It is used something like this...

     <target name="vizant" depends="download.vizant">
         <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" 
classpath="${vizant.jar}"/>
         <vizant antfile="build.xml" outfile="build.dot"/>
         <exec executable="dot" failifexecutionfails="false" 
resultproperty="graphvizSuccess!">
             <arg line="-Tpng build.dot -o build.png"/>
         </exec>
         <fail unless="graphvizSuccess!">
         You probably need to install GraphViz which is a native program,
         not a Java library &gt;&gt;&gt; 
http://www.research.att.com/sw/tools/graphviz/
         </fail>
     </target>

Jake



>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message