ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Problem with pathconvert and map, perhaps a bug
Date Mon, 19 Aug 2002 22:39:07 GMT
--- Michael Rauh <> wrote:
> If i use this code the pathconvert doesn´t work,
> <fileset dir="${resin.home}/webapps/${newbuild.dir}" id="jsp-path">
>   <patternset>
>     <include name="**/*.jsp"/>
>   </patternset>
>  </fileset>
>  <pathconvert pathsep=" " property="resin.http-path" refid="jsp-path">
>    <map from="${resin.home}/webapps/" to="http://localhost/"/>
>  </pathconvert>
> [...]	 
> but if i change:
> <map from="${resin.home}/webapps/" to="http://localhost/"/>
> to
> <map from="D:/tools/resin/resin-2.0.5/webapps/" to="http://localhost/"/>
> it just works  fine.
> But I can`t figure out why?

Because the set of files generated by <fileset> are fully resolved paths,
including the drive letter -- but apparently, that's not true for how you
set the value of ${resin.home}. You can see this by (temporarily) taking
out the <map> element and simply <echo>'ing out ${resin.http-path}.

For example, if I have:
  <target name="showfs">
    <property name="temp.dir" value="sub"/>
    <fileset id="fs" dir="${temp.dir}" includes="*.txt"/>
    <pathconvert pathsep="${line.separator}" property="fs" refid="fs"/>

Running it gives me:
     [echo] D:\cygwin\home\dianeh\work\ant\TEMP\sub\bar.txt
     [echo] D:\cygwin\home\dianeh\work\ant\TEMP\sub\foo.txt

If I wanted to "map off" ${temp.dir}, I'd need to do it with:
      <map from="${basedir}${file.separator}${temp.dir}${file.separator}"

which would give me just the two file names. Note that if I <map> from
${temp.dir}, however, the end result would be exactly as it is without any
<map> at all, because it wouldn't match, since the value of ${temp.dir} is
simply "sub".

However, if I set temp.dir using the 'location' attribute:
    <property name="temp.dir" location="sub"/>

then I could reference ${temp.dir} in my <map>:
    <pathconvert pathsep="${line.separator}" property="fs" refid="fs">
      <map from="${temp.dir}${file.separator}" to=""/>

and that will give me just the same results as mapping with the fully
qualified "${basedir}..." does.



Do You Yahoo!?
HotJobs - Search Thousands of New Jobs

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message