ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick (Gus) Heck" <>
Subject Available Task Unclear documentation? shoule I bug it or is it me?
Date Tue, 21 May 2002 00:11:20 GMT
I was messing with a classpath that was built from properties, and 
suddenly had the thought that it would be nice if the properties for the 
jar files were only set if they existed (did I type in the right path to 
the jar? did I move a jar and break my build without realizing it?). I 
figured I could echo the classpath and see if I was missing something 
since the unset property would come up blank. So I looked up the 
Available task in the docs, and replaced a couple properties. I don't 
see anything in the documentation that says I can't do this.

Yet here is what I get:

Buildfile: build.xml

build.xml:13: Unexpected element "available"

Total time: 3 seconds

I poked around a bit couldn't find anything wrong... printed the version 
of Ant with the I had made to make sure I didn't have ANT_HOME 
screwed up, and such and everything seems fine. After looking at other 
files that use availabe, it seems that available only appears inside of 
<target> but not outside. When I tested it, this appeared to be the root 
of the problem.

There is nothing in the documentation that indicates that some tasks 
(such as property) can occur outside of targets while others (like 
available) must be contained in targets. Such a restriction seems 
potentially reasonable, but it should be documented if it is there. If 
you contrast the documentation about Property and Available, you get no 
indication of this difference, and there is no reference to it in 

So my questions are:

Is the behavior I observed likely to be a problem with my setup?
If not, is it a bug in parsing the build.xml or in available?
If this is the intended behavior, should I start a bug requesting that 
it be documented?

I don't see any reason why available should be restricted to targets 
anyway, at least not when it is checking for file existance.

Of course I can put it in an init task or something but shouldn't this 
be documented? How do I find out what other tasks can appear outside of 

(I did a search and found no bugs mentioning available)

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

View raw message