ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Leftwich <digi...@ix.net.au>
Subject Re: Building a task used in the rest of the build
Date Wed, 30 May 2001 22:41:42 GMT
At 08:06 31/05/01, Diane Holt wrote:
>--- Robert Leftwich <digital@ix.net.au> wrote:
> > I vaguely recall that there was a way to put the building of a task in
> > the  same build file that uses it (i.e. the chicken and egg scenario)
> > but a  quick search of the mailing list fails to turn up anything. Is
> > this  possible or is my memory failing me ?
>
>I believe you should be able to just compile the task, then <taskdef> it.

That's true, but after a clean a ClassNotFoundException was thrown on the 
task class. The problem was that I was relying on a classpath which used a 
fileset to specify all the jars using an include. When I did a clean the 
taskdef jar was deleted and did not appear in the fileset and obviously the 
taskdef class could not be found when required, so a ClassNotFoundException 
was thrown. The fix is to specify a classpath to the jar file with the 
taskdef, i.e. if I do the following :

         <taskdef name="my_task_def" classname="taskdefs.mine"
                  classpath="./jars/my_task_defs.jar">
         </taskdef>

Then everything works after a clean.

Robert


Mime
View raw message