ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: R: global variables
Date Thu, 30 Aug 2007 15:20:23 GMT
On 8/30/07, Pomè Elisabetta <epome@axioma.it> wrote:
> Thank you, but I'm not sure I have understood.
> If I have 3 target (target A with an antcall to target B and an antcall to
> another target C) and I define a property in target B I can't see its value
> in target C. So I thought that properties have the scope of the target in
> which they're defined. Am I wrong?
> But my problem is different 'cause I need to change a value due to some
> condition in order to decide a behavior. I have a foreach loop: inside that
> loop I have to set "something" (a property? I don't think, 'cause properties
> are immutable) when I found a certain condition. Each time I enter the loop
> I need to test this "something" in order to understand whether continue or
> end the loop.

It sounds (antcall chain, foreach loops) like you are trying to use
Ant as an imperative scripting language with method calls and
variables. Ant is not designed for this, and although it has some
support for these constructs, you are using it "against the grain",
which leads to issues (because of property immutability).

Ant "way" is declarative, where high level targets *depend* on lower
level targets (as opposed to antcalling other targets), and loops are
usually built in to tasks, not explicit.

Rather that asking questions about using the scripting features of
Ant, tell us what you are trying to achieve at a higher level and we
may be able to point you to facilities in Ant that could achieve them.

There are things that Ant can't do out-of-the-box, but then one
switches to a real scripting language to achieve them (using <script>
or <scriptdef>), or to writing custom tasks in Java. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message