ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kieran Simpson <kierans...@gmail.com>
Subject Binding of typedefs to namespaces recursively
Date Fri, 08 Oct 2010 06:30:33 GMT
I have an Antlib foo.xml that contains

<antlib>
  <macrodef name="AwesomeTask" />
</antlib>

I have another Antlib bar.xml that uses foo.xml like so

<antlib xmlns:foo="org.foo">
  <typedef uri="org.foo" resource="foo.xml" />

  <macrodef name="CoolTask">
    <foo:AwesomeTask" />
  </macrodef>
</antlib>

I have a build file that uses bar.xml

<project name="my.build">
  <target name="build">
    <typedef resource="bar.xml" uri="org.bar"/>
  </target>
</project>

When I run the build, I get the error that foo:AwesomeTask is
undefined.  Running with verbose on I get:

 [macrodef] creating macro  org.bar:AwesomeTask
 [macrodef] creating macro  org.bar:CoolTask

It seems as if the binding of tasks in foo.xml to "org.foo" is
overridden by the binding of bar.xml to "org.bar".

To increase reuse/modularity across my projects I wanted to have
Antlibs that can use other Antlibs.  Maybe I'm abusing the Antlib
idea.

Regards,
Kieran S

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message