ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kendall Collett" <kcoll...@convio.com>
Subject Re: Using available's property setting ability inside a condition, isit possible?
Date Sat, 09 Nov 2002 22:58:26 GMT
In the documentation for the nested elements of <condition> (see
<http://jakarta.apache.org/ant/manual/CoreTasks/conditions.html>), it says:
    available
    This condition is identical to the Available task, all attributes and
nested elements of that task are supported, *the property and value
attributes are redundant and will be ignored*.

Kendall

----- Original Message -----
From: "David Budworth" <dlbant@nustiu.net>
To: "ANT User List" <ant-user@jakarta.apache.org>
Sent: Saturday, November 09, 2002 16:43
Subject: Using available's property setting ability inside a condition, isit
possible?


> Hi All,
>
> I'm finding that the following doesn't work:
> <target name="find.compiler">
>   <condition property="compiler.found">
>     <or>
>       <available file="jikes" filepath="${env.PATH}"
>          property="compiler.type" value="jikes"/>
>       <available file="javac" filepath="${env.PATH}"
>          property="compiler.type" value="javac"/>
>     </or>
>   </condition>
>   <echo>Compiler found: ${compiler.found}, type: ${compiler.type}</echo>
> </target>
>
> output:
> [echo] Compiler found: true, type: ${compiler.type}
>
>
> The compiler type never gets set.
>
> If I move the available directives outside the condition and comment out
> the condition section I get:
> [echo] Compiler found: ${compiler.found}, type: jikes
>
>
> The ${compiler.found} part is expected in the second output since I
> removed the condition.  But, as you can see, ${compiler.type} gets set
> just fine.
>
> The only workaround for this I can find is to do it the old way, of
> multiple targets with an "unless=compiler.type" tag on them.
>
> Is this a bug?  I found no mention in the docs for condition saying you
> can't set properties inside it like that.
>
> Thank you
> -David Budworth
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>



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