ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: pathconvert/map > not matching
Date Fri, 14 Feb 2003 15:43:03 GMT
Try this:

<property name="cvs.patch.dir"
          location="${patch.dir}/${cvspackage" />

<fileset dir="${cvs.patch.dir}/patch_1"
         includes="**/*.*" id="patch_1.files">
  <present targetdir="${cvs.patch.dir}/patch_2"/>
</fileset>

<pathconvert targetos="unix" pathsep=","
             property="patch_1.files" refid="patch_1.files">
  <map from="${cvs.patch.dir}" to="" />
</pathconvert>

This way, you're sure that the expression matched from is canonical'ized the
same way as the filenames fed to the mapper, i.e. using same file separator,
same drive letter case on Windoze, etc...

The method above will also be platform portable. --DD

-----Original Message-----
From: Dan Gardner [mailto:Dan.Gardner@emap.com] 
Sent: Friday, February 14, 2003 7:43 AM
To: 'Ant Users List'
Subject: pathconvert/map > not matching

I have a fileset that I am pathconvert 'ing.  I'm using a map element to
remove the preceding part of each path.

The actual syntax is below (de xslt'd).

<fileset dir="${patch.dir}/${cvspackage}/patch_1" includes="**/*.*"
id="patch_1.files">
  <present targetdir="${patch.dir}/${cvspackage}/patch_2"/>
</fileset>

<pathconvert targetos="unix" pathsep="," property="patch_1.files"
refid="patch_1.files">
  <map from="${patch.dir}/${cvspackage}" to="" />
</pathconvert>


The map *should* be matching "${patch.dir}/${cvspackage}", but isn't.
pathconvert resolves the filesset to root, so all the paths start from / ,
run up to the build base directory, then continue into
${patch.dir}/${cvspackage}.

i.e. 
build basedir="./" (which is where ANT is run = "/build/ant")
${patch.dir} = patches
${cvspackage} = cvs_project1

So in the property at the end I get "/build/ant/patches/cvs_project1/....  "
etc
I've tried hardcoding the map/from = "/build/ant/patches" but even that does
not work in removing it.

Any ideas ?

cheer
dan
_______________________________
Dan Gardner        Emap IT - UK

Mime
View raw message