You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mark Cooper <ma...@microlise.com> on 2003/01/17 16:39:46 UTC

Depracated use of "Available" Task

Hi all,

I'm currently developing a buildfile which potentially needs a different
set of parameters (taken using the xmlproperty task) depending on which
actual machine it is executed on.

The reason I'm having to do it this way is because <xmlproperty file
="blah.xml"> doesn't work the same as <property file="blah.properties">.
The former crashes the build with an exception because the file is not
found, while the latter doesn't.

I decided to use the "available" task to set a property to the name of the
xml parameter file depending on the machines name, or a default if that
isn't available (hence using "available").

This is working absolutely fine, but Ant is telling me
      [available] DEPRECATED - <available> used to override an existing
property.
      [available]   Build file should not reuse the same property name for
different values.
I've looked through the documentation for Ant 1.5.1 and can't find any
reference to this being depracated, and can't find anything else that would
do the job with an xml based parameter file.

How likely is it that use of the available task to override an existing
property will be removed in a future version?

Can anyone suggest an alternative (apart from using text property files
instead of xml property files, I really wanted to get away from that)?

Mark Cooper




Any views or opinions presented in this Email message are solely those of
the author and do not necessarily represent those of the Microlise Group
unless otherwise specifically stated.
Email communications are not necessarily secure and therefore the Microlise
Group does not accept legal responsibility for the contents of this
message.

If you are not the intended recipient and have received this message in
error, please notify Microlise immediately.

Microlise Group Limited +44 (0)1773 537000




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Depracated use of "Available" Task

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
On Friday, January 17, 2003, at 10:39  AM, Mark Cooper wrote:
> I decided to use the "available" task to set a property to the name of 
> the
> xml parameter file depending on the machines name, or a default if that
> isn't available (hence using "available").

Use a property name that is not being used for some other purpose or 
already has a value - that is the key.

> This is working absolutely fine, but Ant is telling me
>       [available] DEPRECATED - <available> used to override an existing
> property.
>       [available]   Build file should not reuse the same property name 
> for
> different values.
> I've looked through the documentation for Ant 1.5.1 and can't find any
> reference to this being depracated, and can't find anything else that 
> would
> do the job with an xml based parameter file.

Give us a bit more example of what you're doing with a few lines of 
your build file.  If you're just trying to load a different properties 
file for a machine, do this:

	<property file="${machine.name}.properties"/>

where machine.name is a property representing your machine name 
(perhaps from the environment COMPUTERNAME or HOSTNAME).

> How likely is it that use of the available task to override an existing
> property will be removed in a future version?

Not likely - but don't rely on deprecated capability would be my advice.

	Erik


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>