ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Morgan <xera...@yahoo.com>
Subject Does anyone else have interest in this behavior?
Date Fri, 22 Jun 2001 20:41:19 GMT
I needed a way to iterate over a set of files and values, so I wrote
support for some tags that look like this:

<target name="targetA">
  <callover target="targetB">
    <paramset name="param1">
      <fileset dir="myDir" includes="*foo*"/>
    </paramset>
    <paramset name="param2">
      <valueset values="x|y|z|abc" delimiter="|"/>
    </paramset>
  </callover>
</target>

<target name="targetB">
  <echo message="${param1} : ${param2}"/>
</target>


myDir contains the files bar1, bar2, foobar, foo1, and foo2.

When the above is run, the result is:

targetA:

targetB:
     [echo] foo1 : x

targetB:
     [echo] foo1 : y

targetB:
     [echo] foo1 : z

targetB:
     [echo] foo1 : abc

targetB:
     [echo] foo2 : x

targetB:
     [echo] foo2 : y

targetB:
     [echo] foo2 : z

targetB:
     [echo] foo2 : abc

targetB:
     [echo] foobar : x

targetB:
     [echo] foobar : y

targetB:
     [echo] foobar : z

targetB:
     [echo] foobar : abc


So the callover tag provides enumerated values to specified variables in
calls to another target in the file.  Useful mainly for single sets of
values because otherwise it can get unwieldy (n*m combinations).

Since I found this to be amazingly useful, I decided to ask if anyone else
thinks the same.  If so, I could package up the code and put it out.

-Steve Morgan
 xerafin@yahoo.com

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Mime
View raw message