ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: macrodef / subant inherit problem
Date Mon, 24 May 2004 08:28:12 GMT
A cut-down version of the build/import files that
shows the problem would be helpfull.
I have run a small test:

top dir:
  <macrodef name="i">
      <property file=""/>

<project default="sub">
  <import file="im.xml"/>
  <target name="sub">
    <subant inheritall="no" inheritrefs="no">
      <fileset dir="." includes="*/sub.xml"/>

sub dir:
<project default="x">
  <import file="../im.xml"/>
  <target name="x">
    <echo>SUB: basedir="${basedir}"</echo>
    <echo>p is ${p}</echo>

Everything looks fine.

Shackelford, John-Mason wrote:

>I am seeing some odd behavior and wondered if others have noticed this
>I am using subant to call down to another buildfile and have set  both
>inheritall="false" and inheritrefs="false", yet some properties seem to be
>leaking down from the parent to the child, specifically properties that were
>set during a macrodef invocation in the parent. The same macrodef is defined
>and called in both parent and child, yet it appears that the parent's
>definition is inherited by the child rather than being reloaded.
>One symptom:
>1. parent buildfile runs...
>2. loads a macrodef imported from an external file which includes a line:
><property file="" />. 
>3. parent executes this macrodef 
>4. parent calls child via subant 
>5. child loads the same macrodef from the same external file. 
>6. child executes macrodef and the debug output indicates that though the
>child's base directory had been properly, it attempts to load
> from the parent's directory rather than its own.
>There are other symptoms and I'd be happy to provide the 67k debug output if
>it would be helpful.
>John-Mason Shackelford
>Software Developer
>Pearson Educational Measurement - eMeasurement Group
>2510 North Dodge St.
>Iowa City, IA 52245
>ph. 319-354-9200x6214
>This email may contain confidential material. 
>If you were not an intended recipient, 
>Please notify the sender and delete all copies. 
>We may monitor email to and from our network. 
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message