ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Save fileset names to a file.
Date Fri, 16 Jul 2004 13:45:28 GMT
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: Friday, July 16, 2004 1:17 AM
> To: user@ant.apache.org
> Subject: AW: Save fileset names to a file.
> 
> Two possibilities:
> 
> <fileset id="fs" dir="C:/temp"
> includes="**/*.ini,**/*.pdf,**/*.log,**/*.xml"/>
> <property name="fs.value" refid="fs"/>
> 
> That list contains a semicolon separated list of relative paths to
> C:/temp.
> 
> <fileset id="fs" dir="C:/temp"
> includes="**/*.ini,**/*.pdf,**/*.log,**/*.xml"/>
> <pathconvert property="fs.v2" refid="fs" pathsep="${line.separator}">
>     <map from="C:\temp\" to=""/>
> </pathconvert>
> 
> That list contains one entry per line. Because <pathconvert> converts the
> entries of the fileset to absolute filenames, but all have the some root
> directory, use a nested <map> to delete that (platform dependend format).

And to make it platform independent, use an intermediate <property
location="..."> and ${file.separator}:

<property name="temp" location="C:/temp" />
<fileset id="fs" dir="${temp}" includes="..."/>
<pathconvert property="fs.v2" refid="fs" pathsep="${line.separator}">
  <map from="${temp}${file.separator}" to=""/>
</pathconvert>

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


Mime
View raw message