ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Gentle <Ken.Gen...@iMedium.com>
Subject Help with 'pathconvert', please!
Date Tue, 11 Dec 2001 13:06:38 GMT
Hello all - I'm having a really hard time making 'pathconvert' do what I 
think it should.  The build file below is supposed to replace the first 
several characters of a path with a platform specific root, but the 
substitutions don't happen like I thought they should:

<?xml version="1.0"?>
<project name="imf" default="dump-info" basedir=".">
   <property name="tools.unix.iplanet"    value="/opt" />
   <property name="tools.windows.iplanet" value="D:\" />
   <property name="PATH.PREFIX.TOKEN"     value="/prefix" />
   <property name="home.iplanet" 
value="${PATH.PREFIX.TOKEN}/iplanet/ias6/ias"/>

   <path id="path.iplanet">
     <pathelement location="${home.iplanet}/classes/java/iasclient.jar}" />
   </path>

   <target name="generate_classpath" >
     <echo message="BEFORE: PATH.PREFIX.TOKEN=${PATH.PREFIX.TOKEN}"/>
     <echo message="BEFORE: home.iplanet=${home.iplanet}"/>
     <echo message="BEFORE: tools.windows.iplanet=${tools.windows.iplanet}"/>
     <echo message="BEFORE: classpath.project=${classpath.project}"/>
     <pathconvert targetos="windows" property="classpath.project" 
refid="path.iplanet">
       <map from="${PATH.PREFIX.TOKEN}" to="${tools.windows.iplanet}" />
     </pathconvert>
     <echo message="AFTER:  classpath.project=${classpath.project} "/>
   </target>

   <target name="dump-info" depends="generate_classpath">
     <echo message="ant.version=${ant.version}" />
     <echo message="ant.file=${ant.file}" />
     <echo message="" />
     <echo message="java.vm.info=${java.vm.info}" />
     <echo message="java.vm.name=${java.vm.name}" />
     <echo message="java.vm.vendor=${java.vm.vendor}" />
     <echo message="java.vm.version=${java.vm.version}" />
     <echo message="os.arch=${os.arch}" />
     <echo message="os.name=${os.name}" />
     <echo message="os.version=${os.version}" />
     <echo message="" />
     <echo message="classpath.project=${classpath.project}" />
   </target>

</project>

Executing ant against this produces the following:

Buildfile: build.xml

generate_classpath:
      [echo] BEFORE: PATH.PREFIX.TOKEN=/prefix
      [echo] BEFORE: home.iplanet=/prefix/iplanet/ias6/ias
      [echo] BEFORE: tools.windows.iplanet=D:\
      [echo] BEFORE: classpath.project=${classpath.project}
      [echo] 
AFTER: 
classpath.project=e:\prefix\iplanet\ias6\ias\classes\java\iasclient.jar}

dump-info:
      [echo] ant.version=Ant version 1.4 compiled on October 11 2001
      [echo] ant.file=e:\home\kgentle\work\head\imf_ii\build.xml
      [echo]
      [echo] java.vm.info=mixed mode
      [echo] java.vm.name=Java HotSpot(TM) Client VM
      [echo] java.vm.vendor=Sun Microsystems Inc.
      [echo] java.vm.version=1.3.0-C
      [echo] os.arch=x86
      [echo] os.name=Windows NT
      [echo] os.version=4.0
      [echo]
      [echo] 
classpath.project=e:\prefix\iplanet\ias6\ias\classes\java\iasclient.jar}

BUILD SUCCESSFUL

Total time: 1 second

Why does 'pathconvert' ignore the substitution of "D:\" for "/prefix"?
Why does it prepend the "e:\" instead?
Should I be doing this a different way?

Thanks in advance!

	Ken
==========================================================================
J. Kenneth Gentle (Ken)       | Phone: (610)964-2800  FAX: (610)964-9590
iMedium                       | Email: Ken.Gentle@iMedium.com
900 West Valley Rd, Suite 301 |
Wayne, PA 19087-1830          | Direct Phone: (610)225-3560
========================================================================== 


--
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