ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
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">
  <target name="noFoo" depends="checkFoo" unless="foo.present">
    <fail message="Error: File foo not found."/>
  <target name="checkFoo">
    <available file="foo" property="foo.present"/>


--- Jiong Wei <> 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


Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices

View raw message