ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [PATCH] Lazy task class loading
Date Wed, 08 Aug 2001 05:20:44 GMT
Guten Morgen,

On Tue, 7 Aug 2001, Stefan Reich <> wrote:

> I have to admit I'm not entirely firm with how Ant uses
> classloaders. Will the subbuild always have a different classloader?
> Won't it have the outer classloader as a parent and automatically
> inherit all classes loaded by the parent?

Tasks defined by <taskdef> will be loaded by a different classloader
than the one used to load plain Ant tasks - and after your changes the
subbuild won't know about these other classloaders.  The subbuild will
have the same "main" classloader as plain Ant.

> Either way, it seems to me this problem will be solved if I just
> pass the contents of the TaskDefinitionHashtable as-is.


>> And then you want to apply the same logic to data types as well 8-)
> Data types...?

FileSet, PatternSet, Path, Mapper and more recent FilterSet and
FileList.  See dataClassDefinitions, addDataTypeDefinition,
getDataTypeDefinitions and createDataType in Project.

Since Ant 1.4 will have a <typedef> to accompany <taskdef>
it has the same classloader issues as tasks.

Finally, the <antstructure> task will have to be rewritten to make
sure the classes have actually been loaded, no big deal.

>> Stefan
> -Stefan (hehe, if this conversation goes on people will be really
> confused about who said what)

Stefan ;-)

View raw message