ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hammant <paul_hamm...@yahoo.com>
Subject Re: <script> needs a classpath param
Date Wed, 08 Aug 2001 07:01:09 GMT
Mike Williams wrote:

> Mike> <taskdef name="junit" 
> Mike> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
> Mike> <classpath>
> Mike> <pathelement location="${optional.class.path}" />
> Mike> <pathelement location="${junit.home}/junit.jar" />
> Mike> </classpath>
> Mike> </taskdef>
>
> Paul> It's good but not perfect as it forces all <script> or <junit>
> Paul> using targets to have the same classpath.
>
> Er, I don't think so.  It only sets the classpath for defining the
> JUnitTask; the JUnitTask class and supporting libs (ie. junit.jar).  
>
> You can still specify a project-specific path to <junit> later on, eg.
>
><junit>
><classpath>
><pathelement location="build/classes/" />
></classpath>
>...
></junit>


Yup I guess that would work ... if ${optional.class.path} & ${junit.home}/junit.jar &
build/classes/ were loaded into the same classloader (not two) then it would work fine.

Stefan points out that there could be problems for Xalan based tasks because of static factory
methods, but I see this working for <scrip> & <junit>.



=====
Regards - Paul H
====
CVS -1, Perforce +1

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Mime
View raw message