ant-user mailing list archives

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

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"
attributes. 

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 -->
   <available 
    classname="edu.calpoly.dept.group.project.Foo" 
    classpathref="deployment.class.path"
    property="foo.class.present" />
</target>

<target name="stage"
        depends="verify" 
        unless="foo.class.present">

   ...

</target>

...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
offer.

Bill


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


Mime
View raw message