ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Condition to set property value if file exist
Date Wed, 26 Aug 2009 09:19:17 GMT
On 2009-08-26, Mikael Petterson <> wrote:

> I want to set  a property called "local" to

> /tmp/test if directory exists.
> If it does not exist I will check if /local/test exist.
> If it does I will set "local" to /local/test.
> If none of these directories exist I will set "local" to current
> directory.

> Any ideas how I can do this in ant 1.6.5

  <available property="local" value="/tmp/test"
  <available property="local" value="/local/test"
  <property name="local" location="."/>

Since properties are immutable, if either of the first two available
tasks sets the property, the later tasks won't do anything.


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

View raw message