You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2001/09/11 11:42:27 UTC

Re: Attempt at "if-like" task

On Thu, 30 Aug 2001, Ceki Gülc <cg...@qos.ch> wrote:

> There is no need to change the ANT architecture to accommodate
> complex boolean expressions.

Have you seen the <condition> task new to Ant 1.4?  It handles "basic"
boolean expressions quite well, but having the power of a scripting
language would probably make things easier.

When I read your mail the idea of a "script" condition formed in my
mind, something like

<condition property="someprop">
  <script language="javascript">
    foo == bar
  </script>
</condition>

using BSF and giving the script snippets the same access to Ant
properties, references and all the stuff scripts run via the <script>
task have - we would require the script to return a boolean, though.

This is not as powerful as your "if-like" task, but everything beyond
the evaluation of a boolean expression would probably better be run
inside a <script> task anyway IMHO.

What do you think?

Stefan