ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Budworth <>
Subject Using available's property setting ability inside a condition, is it possible?
Date Sat, 09 Nov 2002 22:43:00 GMT
Hi All,

I'm finding that the following doesn't work:
<target name="find.compiler">
  <condition property="compiler.found">
      <available file="jikes" filepath="${env.PATH}"
         property="compiler.type" value="jikes"/>
      <available file="javac" filepath="${env.PATH}"
         property="compiler.type" value="javac"/>
  <echo>Compiler found: ${compiler.found}, type: ${compiler.type}</echo>

[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:   <>
For additional commands, e-mail: <>

View raw message