ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik G. Dybdahl" <gront...@yahoo.no>
Subject Re: iterative tasks
Date Wed, 31 Jan 2001 11:02:34 GMT

--- Nico Seessle <Nico.Seessle@epost.de> skrev: > ----- Original Message -----
> From: "Erik G. Dybdahl" <grontoft@yahoo.no>
> To: <ant-user@jakarta.apache.org>
> 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
> 
> 
I formulated my question a little erronously, but still got
an answer that solved my problem. Thank you.
erik


_____________________________________________________________
Do You Yahoo!?
Få din egen, gratis @yahoo.no-adresse på http://mail.yahoo.no

Mime
View raw message