ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: PathConvert problem with Map
Date Fri, 11 Jul 2003 04:28:09 GMT

Loop through the fileset using ant-contrib's <foreach> and use <basename> 
to grab the file off of each file path.  Then write the property to a 
file.  Once all the values of the file names have been written to the file, 
read the file and you are good to go.  Or, use each filename immediately by 
calling the target that would use it and don't worry about storing the file 
names.

Jake

At 12:10 PM 7/11/2003 +0800, you wrote:
>Or is there any alternative to get all the filenames (without any directory
>structure) of a fileset?
>
>Regards,
>Daniel
>
>
>-----Original Message-----
>From: Daniel Joshua [mailto:daniel.joshua@gridnode.com]
>Sent: Friday, 11 July, 2003 11:31 AM
>To: 'Ant Users List'
>Subject: PathConvert problem with Map
>
>
>Hi,
>
>I want to store filenames (without any directory structure) into a property.
>
>Thus I use the 'map' element of a 'pathconvert' to try and remove the
>directory.
>
>     <fileset id="db.sqlscripts.fileset"
>              dir="${dbscript.dir}"
>              includes="${includes}"
>              excludes="${excludes}"/>
>
>     <pathconvert property="db.sqlscripts.executed"
>                  refid="db.sqlscripts.fileset"
>                  dirsep="/"
>                  pathsep=",">
>       <map from="${dbscript.dir}" to=""/>
>     </pathconvert>
>
>     <echo message="[DEBUG] dbscript.dir = ${dbscript.dir}"/>
>     <echo message="[DEBUG] db.sqlscripts.executed =
>${db.sqlscripts.executed}"/>
>
>... gives the following output...
>
>      [echo] [DEBUG] dbscript.dir = ../sqlscripts/mysql
>      [echo] [DEBUG] db.sqlscripts.executed =
>C:/MyProject/sqlscripts/mysql/create-table.sql
>
>Since one is a relative path and the other is a absolute path, the 'map'
>fails.
>
>Any suggestions?
>
>
>Regards,
>Daniel
>
>
>---------------------------------------------------------------------
>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


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


Mime
View raw message