----- Original Message -----
From: "Erik G. Dybdahl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 9:45 AM
Subject: iterative tasks
> I've organized my EJB-project so that each Entity Bean is packed in its
own
> jar-file, together with the ejb-jar.xml etc.
> Hence I have a build task for each of my EBs in build.xml.
> Noe very elegant, but it works.
> What I would like to have, was a generic task that for each EB
> (defined by a distinct subcatalog) in my source directory
> generated the jar-file for the EB (if needed).
> But Ant does not have loop structures, and not "parameter passing" to
tasks.
> So I have to write my own task, I guess?
>
Right, Ant has no "parameter passing" to tasks, but it has "parameter
passing" to targets.
You could use for example
<target name="myEcho">
<echo message="${arg1}"/>
</target>
<target name="main">
<antcall target="myEcho">
<param name="arg1" value="message 1"/>
</antcall>
<antcall target="myEcho">
<param name="arg1" value="message 2"/>
</antcall>
</target>
and it should output "message 1" and "message 2".
Remaining problem is that there is no "nice" way to declare templates in ant
which can be used in every "sub-build". You must import a file containing
your generic target using the XML-way (using Entities).
Nico