On Sat, 23 Feb 2002 03:45, Stefan Bodewig wrote:
> On Thu, 21 Feb 2002, Jose Alberto Fernandez <[EMAIL PROTECTED]>
>
> wrote:
> >> But even then, we wouldn't solve the current problems.
> >
> > Why not?
>
> There is this task MyEnhancedJunitTask that inherits from JUnitTask.
> I put this task into a jar in my system classpath.  In my build file I
> say
>
> <taskdef name="myjunit" classname="MyEnhancedJunitTask" />
>
> No problem in Ant 1.4 as JUnitTask is on the system classpath as
> well.  But as soon as MyEnhancedJunitTask gets loaded from the system
> classloader (and it will be because of the delegating nature of
> AntClassLoader), it will not see JUnitTask in a setup where it has
> been loaded by a different classloader.
>
> This example is not really that exotic, people do extend certain Ant
> task, see the <javamake> task from the "External Tasks" page, it
> extends Javac.

A more common pattern that is used in user tasks is something like

JUnitTask junit = getProject().createTask("junit");
...

which would break if we were to breakdown classloaders etc

-- 
Cheers,

Pete

*--------------------------------*
| Every rule has an exception,   |
| except the rule of exceptions. |
*--------------------------------*

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to