ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12820] - inheritRefs is broken
Date Wed, 25 Sep 2002 13:39:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12820>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12820

inheritRefs is broken





------- Additional Comments From bodewig@apache.org  2002-09-25 13:39 -------
OK, I see what is happening in your case (either it is still a WORKSFORME or
I need another example 8-):

Your build file (the one you are calling, not the one that gets called, which
happens to be the same file, of course) already defines a reference to "jar".
According to the docs of <ant>:

> The build file of the calling project defines some <path> elements like this:
>
>  <path id="path1">
>    ...
>  </path>
>  <path id="path2">
>    ...
>  </path>
>
> and the called build file (subbuild.xml) also defines a <path> with the id
> path1, but path2 is not defined:
>
>  <ant antfile="subbuild.xml" inheritrefs="true"/>
>
> will not override subbuild's definition of path1, but make the parent's
> definition of path2 available in the subbuild.

In your case, the fileset "jar" takes the role of "path1" and will not be
overridden. You get the error message, because the child build's "jar" has not
been configured (the "init" target has not been run).

> In fact, if you read further in the manual
>
>  <ant antfile="subbuild.xml" inheritrefs="false">
>    <reference refid="path1"/>
>  </ant>
>
> will override subbuild's definition of path1.

changing your build file to read

  <target name="testInheritRefs" description="Test Ant Call with inheritRefs"
depends="compile, init">
    <antcall target="testInheritRefs1">
      <param name="foo" value="foobar modified"/>
      <reference refid="jar"/>
    </antcall>
  </target>

yields

[bodewig@bodewig antBug]$ ant testInheritRefs           
Buildfile: build.xml

compile:

init:

testInheritRefs:
Overriding previous definition of reference to jar

testInheritRefs1:
     [echo] foobar modified
     [java] calling the helper

BUILD SUCCESSFUL
Total time: 2 seconds

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


Mime
View raw message