ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
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:
  http://marc.theaimsgroup.com/?l=ant-user&m=101416288305810&w=2

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:\"/>
    </pathconvert>
    <echo message="mapped ${dist.dir} ==> ${p1}"/>
  </target>

You get:
testtarget:
     [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
</pathconvert>:
    <dirname property="p1" file="${p1.tmp}/>

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

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message