ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Question: fail handling in ANT
Date Fri, 20 Apr 2001 18:50:26 GMT
For a specific file, you can use a combination of the <available> task and
the "unless" <target> attribute:
  <target name="copyFoo" depends="noFoo">
    <copy.../>
  </target>
  
  <target name="noFoo" depends="checkFoo" unless="foo.present">
    <fail message="Error: File foo not found."/>
  </target>
  <target name="checkFoo">
    <available file="foo" property="foo.present"/>
  </target>

Diane

--- Jiong Wei <jwei@atg.com> wrote:
> 
> I notice the "failonerror" attribute only available for the following
> tasks:
> 	<apply> <exec> <execon> <java>
> 	<javac> <javadoc> and .NET tasks
> 
> If true, then how to fail a build when such as a critical <copy> failed?
> Currently, even when the src file is missing, ant still continues.
> 
> Also, the I really have no clue how to tigger the <fail> task, is there
> a
> ant property indicates the status of last operation?
> 
> Jiong
> 
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Mime
View raw message