ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: While Looping in ANT
Date Sat, 23 Jul 2005 05:42:14 GMT
Hello Jacob,

I am not quite sure I understand what do you mean.

--- "Jacob, Anil - MWL"
<> wrote:
> Does anyone know how I implement a loop similar to a
> while loop?

Generally, ant-contrib[1] provides looping tasks like
<for> and <foreach>.
>  I want to keep checking to see if a particular
> property is set in a
> target, once that target is executed it can be a
> while before the
> property is finally set,
What does "a while before" means? If you read the
value of the property from a kind of "asynchronous"
source, you may find useful <sleep>[2] task. Using
<sleep> you can pause your build process for
arbitrarily long time.

>then once the property is
> set I can execute
> another target.
> I would like to know how to keep checking for a
> property without exiting
> the ant JVM.

Well, after all you can always code a task, or a
script that implements a while loop until the property
is set (not tested, written only by memories):
    <scriptdef name="checkProp" language="javascript">
        <attribute name="property"/>
            prop = attributes.get("property");
            while (project.getProperty(prop) == null)
//keep going
//here the property must be set

HTH Ivan

> Thx
> Anil

Start your day with Yahoo! - make it your home page 

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

View raw message