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 16:50:29 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 hoju@visi.com  2002-09-25 16:50 -------
I figured out my issue, although I still think there is a little bit of 
weirdness...

I have:

build.xml
<path id="build.classpath">
   <fileset="${build.lib.dir}">    
       <include name="*.jar"/>
   <fileset>
</path>
<target name="sometarget">
    <ant antfile="build-contrib.xml" target="control" inheritRefs="true" />
</target>

build-contrib.xml
<taskdef resource="net/sf/antcontrib/antcontrib.properties" >
    <classpath refid="build.classpath" />
</taskdef>
...
...
<target name="blah">
    <if>
        <not><isset property="somepropery" /></not>
        <then>
            <echo message="somproperty not set"/>
        </then>
    </if>
</target>

Ant reports that the build fails with:

BUILD FAILED
file:D:/myclasses/repository/enhydra/Barracuda_2002-09-23/Barracuda/src/build.xm
l:935: Reference build.classpath not found.

However, if I move that <taskdef> into a target, I don't get the error.  
Further, even if I don't get that error, I have to make sure that the target 
which contains the taskdef gets set up as a dependency of the "control" target 
so that it runs before any other target using tasks defined by the <taskdef>.

I guess I am confused by the fact that the path reference can't be found 
outside the scope of a target in the child build file?  I have properties 
defined at the top of the build file and they get seen by everything else.  Why 
can't I have a taskdef at the top of a build file, outside a target, that gets 
seen by everything else?  Apparently, I can't because the path reference is not 
available there.

Is that a bug or was that done by design?

Jake

--
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