ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: using foreach with fileset
Date Thu, 18 Dec 2003 08:38:36 GMT
If using ant-contrib:<for> one cannot use <basename> as the same
scope for properties is used.
On unix I use this:
            <propertyregex override="yes"
                           property="program"  input="@{filename}"
                           regexp=".*/([^\.]*)\.cpp" replace="\1"/>

to extract the name of the executable from a filename.
Peter

Jan.Materne@rzf.fin-nrw.de wrote:

>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
>>
>>    
>>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message