ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Abusing the BuildListener
Date Fri, 14 Jul 2006 18:46:50 GMT
--- Henri Yandell <flamefew@gmail.com> wrote:

> On 7/14/06, Matt Benson <gudnabrsam@yahoo.com>
> wrote:
> >
> >
> > --- Henri Yandell <flamefew@gmail.com> wrote:
> >
> > > On 7/14/06, Matt Benson <gudnabrsam@yahoo.com>
> > > wrote:
> > > > --- Henri Yandell <flamefew@gmail.com> wrote:
> > > >
> > > > > Is that going to be impossible for subtags,
> or
> > > do I
> > > > > just need to grok
> > > > > how UnknownElements work etc?
> > > >
> > > > Am I being dense here?  I haven't grasped why
> you
> > > need
> > > > to use UEs instead of using task/type classes
> > > > directly.  The UnknownElement is generally an
> > > artifact
> > > > of Ant's XML configuration mechanism and can
> > > (should)
> > > > be bypassed in programmatic Ant usage.
> > >
> > > Entirely me being dense - this is my first time
> > > digging into these parts of Ant.
> > >
> > > When I inspect the event in taskStarted, it
> consists
> > > of
> > > UnknownElements, so my first attempt was to
> > > duplicate the structure of
> > > one of these to get my <formatter>. I can mimic
> one
> > > happily enough
> > > (for all the getXxx responses), but something's
> not
> > > right in my
> > > mimicry as it falls over.
> > >
> > > Just making an
> > >
> >
>
"org.apache.tools.ant.taskdefs.optional.junit.FormatterElement"
> > > and adding that seems good, but looking at the
> API
> > > for UnknownElement,
> > > I don't see a way to add anything to it that
> isn't
> > > another
> > > UnknownElement.
> >
> > whoo, I'm confused... none of the classes in
> > oata.taskdefs.optional.junit, including
> > FormatterElement appears to have any knowledge of
> > UEs... so it looks at my admittedly casual glance
> like
> > you could just programmatically set the properties
> > (xml attributes) of a FormatterElement in code and
> add
> > it to your JUnitTask instance.  Is there a reason
> > (that my perfunctory analysis didn't find) that
> this
> > won't work?
> 
> I don't have a JUnitTask instance :(
> 
> I'm using the BuildListener interface, and I just
> get an
> UnknownElement object that represents the <junit>
> (and I guess later
> on becomes a JUnitTask).
> 
> Thanks all for putting up with this btw, I know I'm
> being an ignorant
> newbie here :)

'sokay--you do a lot for the community with your
Jakarta hat(s) on.  ;)  Can you try calling
maybeConfigure(), followed by getRealThing() on your
UnknownElement to get your JUnitTask instance?

-Matt

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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message