ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Brooks <>
Subject Using <available> and <fail> with 1.4.1
Date Thu, 05 Sep 2002 00:22:35 GMT

I've been on this list and using Ant since 1.2, and unlike the occasional
poster to this list that complains about the quality of the Ant docs, I
always thought the were outstanding for an open source project. That is,
until I decided to start using <available> in my build files. 

I can't figure out how to use this task in conjunction with the <fail>
task to abort the build if a resource isn't available, because the
<fail> task in 1.4.1 doesn't support the "if" or "unless"

I'm sure I'm missing something.

Consider the case where a class, Foo, must be available for a particular 
build to succeed. I have the following two targets in my file:

<target name="verify" 
        description="Verifies that all prequisite elements are deployed">
   <!-- The Foo class must already be deployed -->
    property="foo.class.present" />

<target name="stage"



...when I, by hand, deleted the file Foo.class, Ant still attempts to
invoke the 'stage' target even though the property 'foo.class.present'
shouldn't be set.

Is there some way I can use the <fail> target to make the build fail
if Foo.class isn't available? Thanks in advance for any help you can


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message