ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: Available Task Unclear documentation? shoule I bug it or is it me?
Date Tue, 21 May 2002 00:41:00 GMT

----- Original Message -----
From: "Patrick (Gus) Heck" <>
To: "Ant Developers List" <>
Sent: Monday, May 20, 2002 5:11 PM
Subject: Available Task Unclear documentation? shoule I bug it or is it me?

> 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 are looking at the 1.4 docs then it aint there; we added some more
text precisely to reduce this confusion.

> you contrast the documentation about Property and Available, you get no
> indication of this difference, and there is no reference to it in
> using.html.

see above

> 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?

could do, but would be closed off as invalid.

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

because it is really hard to draw the line as to what should be be inside,
and what should be out. There is always a line, and you have just tripped
over it. Sorry.

> 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
> targets?

see above regarding docs. Better to file a bug about 'better error messages'
in ant itself, something like "this may be a task you cannot use outside a
target". That is something that we can still do, and I like helpful error
messages as they are more likely to be read than the docs.


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

View raw message