Yes. I'm running on *nix. The cool thing about it is that you can add things to your
initial fileset without changing the rest.
So a cross-platform example would be (tested on Linux and Windows 2000):
<property name="web.src.dir" value="${basedir}${file.separator}src" />
<property name="web.deploy.dir" value="${basedir}${file.separator}deploy" />
<fileset id="web.src.files" dir="${web.src.dir}">
<include name="images/*.gif" />
<include name="images/*.jpg" />
<include name="javascript/*.js" />
<include name="stylesheets/*.css" />
</fileset>
<pathconvert pathsep="," property="files" refid="web.src.files">
<map from="${web.src.dir}${file.separator}" to="" />
</pathconvert>
<delete>
<fileset dir="${web.deploy.dir}" includes="${files}" />
</delete>
-----Original Message-----
From: Dominique Devienne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 3:06 PM
To: 'Ant Users List'
Subject: RE: Patternsets and Filesets
Cool ;-) And congratulations ;-)
Are you running on *nix? I would guess so, because of your
from="${web.src.dir}/". I'm not 100% sure, but I believe you have to be
careful with the path separator you use. To be really cross-platform, you
should do:
<property name="web.src.dir" location="..." />
<fileset id="myfiles" dir="${web.src.dir}/images">
<include name="*.gif" />
<include name="*.jpg" />
</fileset>
<pathconvert pathsep="," property="files" refid="myfiles">
<map from="${web.src.dir}${file.separator}" to="" />
</pathconvert>
<delete>
<fileset dir="${web.deploy.dir}" includes="${files}" />
</delete>
Note the use of <property location="" /> for the property used in <map
from=""/> and the use of ${file.separator} instead of /.
But if you are on Windows, then I'm wrong. --DD
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>