--- Michael Rauh <[EMAIL PROTECTED]> 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"/>
<echo>${fs}</echo>
</target>
Running it gives me:
showfs:
[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}"
to=""/>
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=""/>
</pathconvert>
and that will give me just the same results as mapping with the fully
qualified "${basedir}..." does.
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>