ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Breedveld" <>
Subject classpath in custom task?
Date Wed, 12 Jun 2002 21:33:05 GMT

I wrote a custom task that will perform some common tasks in our development
environment. It is suppose to work like this:

  <taskdef name="createdatabase" classname="MyAntTask">
      <path location="c:/myanttask/build"/>

  <target name="test">
    <createdatabase name="test"/>

The problem is that all the classes used in the class MyAntTask have to be
included in the classpath. I don't want to copy to jars to the ant dir or
set the CLASSPATH environment variable because that seems to make
maintainability more difficult. What I would like is using a path like
structure like this:

  <target name="test">
    <createdatabase name="test">
        <fileset dir="c:/pathtomyclasses/lib">
          <include name="**/*.jar"/>

This can way I could also use a refid to a path like structure which was
already defined in the buildfile anyway! My question is: is this possible?
The setClasspath() should receive the path information from the
createdatabase task but what should I do with it? How do I get the VM to
load the jars in the setClasspath() function? Anyone any ideas?



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message