ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <>
Subject Re: [VOTE]: Getting 1.6 out the door
Date Wed, 17 Sep 2003 11:38:51 GMT
On Wednesday 17 September 2003 12:22, Stefan Bodewig wrote:
> On Wed, 17 Sep 2003, peter reilly <> wrote:
> > I have done some more investigation.  The reason why using defined
> > definitions do not work unless antlib is an taskcontainer is
> > UnknownElement#handleChildren. This loops tru the all unknown
> > elements and checks if the parent can handle them. After
> > handleChildren is called, the maybeConfigure is called which invokes
> > the defines if addConfigured(AntlibInterface) is used in antLib.
> So you need to supress/delay the invocation?  I'm not sure I follow
> you, sorry.

Sorry my description was a little incoherent.

I wrote an Antlib with:

    public void addConfigured(AntlibInterface nestedTask) {
        System.out.println("Antlib: addConfigured");
        if (nestedTask instanceof Task) {
            setLocation(((Task) nestedTask).getLocation());
        if (nestedTask instanceof Task) {
            ((Task) nestedTask).perform();

and tested it with an antlib:

<antlib xmlns:c="ant:current">
  <presetdef name="define.with.echo">
    <typedef classtype=""/>
  <c:define.with.echo name="define.test"/>

The <c:define.with.echo> element gets rejected in 
UnknownElement#handleChildren() before
Antlib#addConfigured() is called for the <presetdef> element
of the antlib.


> > A fix could be to keep antlib being a task container, but check
> > if the type of task/type is a AntlibInterface, and if not, to
> > reject the task/type.
> I don't think so.  To me it seems that it should be possible for
> <antlib> to accept arbitrary AntlibInterface instances as children
> without resorting to TaskContainer.  If Antlib can't do that, it feels
> as if something was not right ATM.
> Stefan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message