ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: PATCH: taskdefs and class loaders
Date Wed, 18 Jul 2001 14:42:03 GMT
On Wed, 18 Jul 2001, Conor MacNeill <>

> It may be dangerous to assume that tasks which use the same
> classpath can use the same classloader. I am already dealing with a
> task which initialises a singleton.

Well, I think it's not less dangerous to assume that tasks defined
with different taskdefs have been loaded by different class loaders -
and Singletons are evil anyway 8-)

> Therefore, I would prefer an approach where the build file writer is
> explicit about which tasks should use the same loader.

Maybe - I still wonder why they need to be loaded using the same class
loader at all.  You may remember that I proposed to load each tasklib
using a classloader of its own for Ant2.  So we should analyze what
Costin is trying to do here, to make sure it will be possible some way
in Ant2.

> <taskgroup>
>    <classpath refid="blah"/>
>    <taskdef name="foo" classname=""/>
>    <taskdef name="bar" classname=""/>
> </taskgroup>

Similar to the part of the patch that I have committed, you just move
the definitions from a property file to XML where it may be more
obvious to the reader - works for me.


View raw message