Yes, I think that qualifies as jumping through hoops. ;-) You might want to try <pathconvert> for this, which will get you down to just a few lines. One gotcha to keep in mind - you'll want to canonicalise your root path first so that the substring always matches.

(Sorry, I don't have an example handy right now, otherwise I'd post it.)

--
Martin Cooper


On Sun, 6 Mar 2005, Abbey Sparrow wrote:

I am currently jumping through a couple of hoops in order to get relative classpaths in my manifest:

        <!-- Set Classpath -->
        <path id="project.class.path" >
       <fileset dir="${thirdPartyLibraries}">
           <include name="**/*.jar"/>
       </fileset>
       <pathelement location="${libraries}/Apollo.jar"/>
       <pathelement location="${libraries}/Sphinx.jar"/>
       <pathelement location="${libraries}/JSphinx.jar"/>
       <pathelement location="${libraries}/JHotep.jar"/>
       <pathelement location="${libraries}/JCereal.jar"/>
   </path>

   <!-- Make Classpath Relative -->
   <path id="root.path">
       <pathelement path="${antRoot}"/>
   </path>
   <record name="cp.txt" action="start" emacsmode="true" />
       <echo>${toString:project.class.path}</echo>
   <record name="cp.txt" action="stop"/>
   <replace
       file="cp.txt"
       token="${toString:root.path}"
       value=".."
   />
   <loadfile property="classpath" srcFile="cp.txt"/>
    <echo>${classpath}</echo>

Is this the only way to do this, or is there some other, better method I am missing?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to