All I want to do is set a reference to a path on a parent build.xml and use it on a child build.xml (called with <ant>). Here's the simplest example I could create:
build-parent.xml
<?xml version="1.0"?>
<project name="parent" default="do-parent">
<target name="do-parent">
<path id="inherited.path"/>
<ant antfile="build-child.xml" inheritrefs="false" inheritall="false">
<reference refid="inherited.path"/>
</ant>
</target>
</project>
build-child.xml
<?xml version="1.0"?>
<project name="child" default="do-child">
<pathconvert property="converted.path" refid="inherited.path"/>
<target name="do-child"/>
</project>
I run ant.bat -f build-parent.xml
and get: Reference inherited.path not found.
If I change build-child.xml to be:
<?xml version="1.0"?>
<project name="child" default="do-child">
<target name="do-child">
<pathconvert property="converted.path" refid="inherited.path"/>
</target>
</project>
It works fine...
Obviously I could work around this in several ways, but I wanted to do this the proper way. What am I doing wrong?
This behavior has been encountered before:
Passing References from Master Build File to Child
I couldn't find anything that suggests whether this behavior is by design.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With