ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: pathconvert - why doesn't this work?
Date Sat, 30 Mar 2002 22:07:04 GMT
Hi Steve,

Remember this thread from last month:

Now that I've added FileList refid support for <pathconvert>, it might
actually do what you need (you do need to specify at least one file for
<filelist>, and it wasn't clear to me if that's what you ultimately needed
or not, but if not, you can just use a "foo" file -- see below).

Given this:
  <property name="dist.dir" value="/build" />
  <filelist id="dist.dir" dir="${dist.dir}" files="foo"/>
  <target name="testtarget">
    <pathconvert targetos="windows" property="p1" refid="dist.dir">
      <map from="/" to="c:\"/>
    <echo message="mapped ${dist.dir} ==> ${p1}"/>

You get:
     [echo] mapped /build ==> c:\build\foo

If you don't actually want a filename included in ${p1}, you could set a
temp prop in the <pathconvert>, then <dirname> that down for ${p1} -- eg.,
in the above target, change property="p1" to "p1.tmp", then add, after the
    <dirname property="p1" file="${p1.tmp}/>

Now the <echo> returns:
     [echo] mapped /build ==> C:\build



Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover

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

View raw message