ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: using foreach with fileset
Date Thu, 18 Dec 2003 08:02:43 GMT
Use <basename>.
Because <foreach> forms an implicit <antcall> around the target, a new
scope for properties is opened and you can use that.


Jan

> -----Original Message-----
> From: Mark Lybarger [mailto:Mark.Lybarger@CBC-Companies.com]
> Sent: Wednesday, December 17, 2003 7:44 PM
> To: Ant Users List (E-mail)
> Subject: using foreach with fileset
> 
> 
> i'm trying to use the ant-contrib foreach task to generate 
> deployment descriptors for my ejbs.  the bean.name in the 
> descriptor.detail target is getting set to the full path name 
> of the file that's included in the 
> bean.implementation.classes path.  is there a way to have it 
> be just the actual file name apart from the file path name?  
> perhaps a "better" way to do this?  
> 
>   <target name="deployment.descriptor">
>     <foreach target="descriptor.detail" param="bean.name" 
> inheritall="true" parallel="true">
>         <path refid="bean.implementation.classes"/>
>     </foreach>
>   </target>
>   
>   <target name="descriptor.detail">
>         <echo>beginning ${bean.name}</echo>
>         <ejbdoclet verbose="on" ejbspec="2.0" 
> destDir="${basedir.webapp.web-inf.src.gen}">
>             <fileset dir="${basedir.webapp.web-inf.src}">
>                 <include name="**/(${bean.name}"/>
>             </fileset>
> 			<deploymentdescriptor 
> destinationFile="{0}-ejb-jar.xml"/>
> 			<weblogic 
> destinationFile="{0}-weblogic-ejb-jar.xml"/> 			
>         </ejbdoclet>
>   </target>
> 
> thanks!
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message