ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: Setting classpath for optional task
Date Thu, 01 Mar 2001 19:19:06 GMT
----- Original Message -----
From: "William Lee" <wlee@sendmail.com>
To: "Ant User" <ant-user@jakarta.apache.org>
Sent: Thursday, March 01, 2001 6:47 PM
Subject: Setting classpath for optional task


> Is there a way I can set the classpath for the optional tasks WITHIN the
> ant build.xml?  For now, if I want to use a task such as JUnit, I need
> to set the classpath explicitly before I call the ant main class.  Since
> I don't really want to depend on the environment variable CLASSPATH for
> various reasons, I can't really use the "ant" script to invoke the
> build.xml that has a JUunit task.  I ended up writing something similar
> to the "ant" with my custom CLASSPATH.  Is there anyway to get around
> it?

You could try to "redefine" the junit-task using something like

<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
  <classpath>
    <fileset dir="./lib">
       <include name="junit.jar"/>
    </fileset>
  </classpath>
</taskdef>

Don't know if this works (and if I have made some errors above) - just try
it.

Nico



Mime
View raw message