ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Matzke <Bernd.Mat...@forcont.de>
Subject RE: Referencing a path id in another build file
Date Fri, 17 Jan 2003 14:54:50 GMT
hi,
you should use the inheritrefs-attribute in the ant-command.
regards

<target name="foo">
    <ant antfile="bar.xml" target="print-foo.cp" inheritrefs="true"/>
</target>  


-----Original Message-----
From: Nau, Michael [mailto:Michael.Nau@pyxis.com]
Sent: Friday, January 17, 2003 10:19 AM
To: ant-user@jakarta.apache.org
Subject: Referencing a path id in another build file


Is there a way to reference a path id setup in foo.xml in bar.xml?

For example:

foo.xml
=============================================  
<project name="foo" default="" basedir=".">
  <path id="foo.cp">
    <pathelement location="${lib.dir}/j2ee.jar"/>
    <pathelement location="${lib.dir}/junit.jar"/>
  </path>

  <target name="foo">
    <ant antfile="bar.xml" target="print-foo.cp"/>
  </target>  
</project>
=============================================  

bar.xml
=============================================  
<project name="bar" default="" basedir=".">
  <target name="print-foo.cp">
    <pathconvert property="formatted-path" pathsep="${line.separator}
" refid="foo.cp"/>
    <echo message="path = ${formatted-path}"/>
  </target>  
</project>
=============================================  

output
=============================================  
D:\Temp>ant -f foo.xml foo
Buildfile: foo.xml

foo:

print-foo.cp:

BUILD FAILED
file:D:/Temp/bar.xml:3: Reference foo.cp not found.

Total time: 1 second
=============================================  

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message