ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: About: Overriding previous definition of reference
Date Tue, 19 Nov 2002 21:22:34 GMT
I'll answer my own question about the turn around:

By adding the following setter to my BuildPath custom data type:

    /**
     * Turn around the 'overriding reference' warning message.
     *
     * @param  id The id name to use for the datatype
     */
    public void setIdent(String id) {
        getProject().addReference(id, this);
    }

and changing the build.xml as follows:

    <buildpath ident="resolved-buildpath" ...>
      ...
    </buildpath>

I don't get the warning message anymore.

But I shouldn't have to do that ;-) --DD

PS: Why are id attributes dealt with specifically at parse-time again????

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com] 
Sent: Tuesday, November 19, 2002 3:11 PM
To: Ant Developers List
Subject: About: Overriding previous definition of reference 

I'm developing a custom data type that extends Path (<buildpath>), and when
I assign it an 'id' attribute to it (in the build.xml fragment at the
bottom), I get the following warning message from Ant (1.5.1):

	Overriding previous definition of reference to resolved-buildpath

Is this normal? A bug?

The trimmed debug output below shows that the reference is first assigned to
an UnknownElement, and later re-assigned to my resolved custom data type
(both lines made to stand out using vvv ^^^).

Could this be made to work fine in 1.5.1 without the warning message?

Thanks to let me know, --DD

PS: Stefan, are you still at work by chance at past 10pm ;-)


P:\com_lgc\tahoe\modules\buildmagic>build -debug buildpath
Apache Ant version 1.5.1 compiled on October 2 2002
Buildfile: P:\com_lgc\tahoe\modules\buildmagic\build.xml
Detected Java version: 1.4 in: C:\pro\jdk1.4.0_01\jre
Detected OS: Windows 2000
...
+Target: buildpath
   +Task: typedef
   +Task: property
   +Task: property
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvv
Adding reference: resolved-buildpath ->
org.apache.tools.ant.UnknownElement@f8c6df
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^
   +Task: property
   +Task: echo
...
buildpath:
...
  [typedef] Loading definitions from resource
com/lgc/buildmagic/types.properties
ResourceStream for com/lgc/buildmagic/types.properties loaded from ant
loader
Finding class com.lgc.buildmagic.BuildPath
Class org.apache.tools.ant.types.Path loaded from parent loader
Class com.lgc.buildmagic.BuildPath loaded from ant loader
...
 +User datatype: buildpath     com.lgc.buildmagic.BuildPath
Setting project property: destdir -> P:\com_lgc\tahoe\modules\build
Setting project property: dependencies ->
P:\com_lgc\tahoe\modules\dependencies.xml
   +DataType: buildpath
Class java.lang.String loaded from parent loader
Class java.io.File loaded from parent loader
Class org.apache.tools.ant.types.Parameter loaded from parent loader
Class org.apache.tools.ant.types.Reference loaded from parent loader
Finding class com.lgc.buildmagic.BuildPathResolver
Class java.lang.Object loaded from parent loader
Class org.apache.tools.ant.types.Parameterizable loaded from parent loader
Class com.lgc.buildmagic.BuildPathResolver loaded from ant loader
Class java.util.Vector loaded from parent loader
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Overriding previous definition of reference to resolved-buildpath
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Class java.lang.Class loaded from parent loader
Finding class com.lgc.buildmagic.TahoeBuildPathResolver
Class com.lgc.buildmagic.TahoeBuildPathResolver loaded from ant loader
...
Adding reference: resolved-buildpath -> ...
Couldn't load ResourceStream for
META-INF/services/org.apache.commons.jxpath.JXPathContextFactory
Setting project property: resolved-buildpath -> ...
     [echo] resolved-buildpath = ...

BUILD SUCCESSFUL
Total time: 2 seconds

P:\com_lgc\tahoe\modules\buildmagic>

  <target name="buildpath" depends="compile">
    <typedef resource="com/lgc/buildmagic/types.properties">
      <classpath>
        <path refid="classpath-default" />
        <pathelement location="../../jar/junit.jar" />
      </classpath>
    </typedef>

    <property name="destdir" location="../build" />
    <property name="dependencies" location="../dependencies.xml" />

    <buildpath id="resolved-buildpath"
 
resolverClassname="com.lgc.buildmagic.TahoeBuildPathResolver">
      <param name="destdir" value="${destdir}" />
      <param name="dependencies" value="${dependencies}" />
    </buildpath>

    <property name="resolved-buildpath" refid="resolved-buildpath" />
    <echo message="resolved-buildpath = ${resolved-buildpath}" />
  </target>

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

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