You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Martin <mg...@hotmail.com> on 2002/04/11 15:57:35 UTC

Re: Using available's property setting ability inside a condition, isit possible?

On a related note
How does one extend the classpath in java task
I set classpath as such
<java classpath="./lib/newjar.jar;${classpath}" ....
but I find this classpath specification does not work
I find that adding a property into global classpath works
Am I implementing classpath in java correctly?
Thank You,
Martin
----- Original Message -----
From: "Kendall Collett" <kc...@convio.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Saturday, November 09, 2002 6:58 PM
Subject: Re: Using available's property setting ability inside a condition,
isit possible?


> 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" <dl...@nustiu.net>
> To: "ANT User List" <an...@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:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>

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