ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject Re: Abusing the BuildListener
Date Tue, 18 Jul 2006 18:47:40 GMT
On 7/14/06, Matt Benson <gudnabrsam@yahoo.com> wrote:

> Henri:  Did you ever get this working?
>
> -Matt

Sorry, was working on it on Saturday but then an unhappy 2 year old
intervened before the reply was finished. Replying below, thanks for
the followup.

On 7/14/06, Matt Benson <gudnabrsam@yahoo.com> wrote:

> Can you try calling
> maybeConfigure(), followed by getRealThing() on your
> UnknownElement to get your JUnitTask instance?

Thanks Matt, the code looks really good now - just doesn't work :(

Here's where I am:

            if(event.getTask().getTaskName().equals("junit")) {
                Task task = event.getTask();
                UnknownElement ue = (UnknownElement) task;
                ue.maybeConfigure();
                JUnitTask jut = (JUnitTask) ue.getRealThing();
                jut.setHaltonerror(false);
                jut.setHaltonfailure(false);
                FormatterElement fe = new FormatterElement();
                FormatterElement.TypeAttribute feta = new
FormatterElement.TypeAttribute();
                feta.setValue("xml");
                fe.setType(feta);
                jut.addFormatter(fe);
            }

The Halt's have stopped working, which I'd previously overridden via:

                RuntimeConfigurable rc = ue.getWrapper();
                rc.setAttribute("haltonfailure", "false");
                rc.setAttribute("haltonerror", "false");

Looking at UnknownElement, I think the real call to maybeConfigure
from within Project blows away the one that I've put in place, then
applies the RuntimeConfigurable again.

(then I continued to dig into things but didn't get anywhere in particular)

Hen

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


Mime
View raw message