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 <[EMAIL PROTECTED]> 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
> 
> 


=====
([EMAIL PROTECTED])



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

Reply via email to