ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Abdelnur <alejandro.abdel...@sun.com>
Subject Re: [PATCH] PropertyCopy and Foreach (NEW OPTIONAL TASKS)
Date Fri, 21 Sep 2001 18:20:48 GMT
matthew,

i've been there already, submitted code doing that, it has been rejected.

it is not the first time, or second time, that these features are proposed. i
think the the folks driving the evolution of ant should start considering
these features again, they should listen a little more of what developers/user
want/need.

fyi:

for embedded properties i modified the project helper, so you can use embedded
variables "a.${b}.c" everywhere.

for looping i've implemented the "xantcall" target, extending the "antcall"
target that supports iterations:

    <xantcall target="TARGET" iterate="LIST" iterator="VAR"/>

where VAR is the name of the variable taht will have the element of the
current iteration.

you can find the code in the archives.

regards.

a

Matthew Inger wrote:

> attached are two useful tasks i have written, that would
> be helpful to be put into the next release:
>
> PropertyCopy - double dereferencing (ie. ${a.${b}.c})
>
>   this essentially takes the "from" attribute and treats
>   it as a property name.  It gets the value of that property
>   and puts it in the property given by the "name" attribute.
>   It's useful when you have property names that follow a certain
>   pattern with some identifier in it (ie. org.TEST.server)
>
>   ex. <propertycopy name="NewVar" from="a.${b}.c" />
>
> Foreach - relatively self explanatory
>
>   ex. <foreach list="${items}" target="callMe"
>                param="item" delimiter="," />
>
> I'm sure there are foreach tasks floating around, but
> while i'm posting propertycopy i might as well post
> the foreach task as well.
>
> --
> Matt Inger (matt.inger@sedonacorp.com)
> Sedona Corporation
> 455 S. Gulph Road, Suite 300
> King of Prussia, PA 19406
> (484) 679-2213
> "Self-respect - the secure feeling that no one,
>  as yet, is suspicious." -H.L. Mencken
>
>   ------------------------------------------------------------------------
>                         Name: PropertyCopy.java
>    PropertyCopy.java    Type: text/x-java
>                     Encoding: 7bit
>
>                    Name: ForEach.java
>    ForEach.java    Type: text/x-java
>                Encoding: 7bit


Mime
View raw message