ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <>
Subject RE: Can Ant iterate?
Date Thu, 22 Aug 2002 17:45:36 GMT
Yes it is possible to build a task and then use it later. I do it all
the time. 

You set up one target that builds the source for the task into a set of
.class files, or a .jar file. 

You set up another target that has a taskdef in it for your task, the
classpath element in the taskdef points to the .class files or to the
.jar file.

<target name="buildit"> 
        <javac ... /> 

<target name="doit" depends="buildit"> 
        <taskdef name="mytask" class="com.something.myanttask"> 
                <classpath ...> 
        <mytask ... /> 

Fill in the ...'s where appropriate and you should be home free. 

Richard Hensley 

-----Original Message----- 
From: Gordon Tyler [
<> ] 
Sent: Thursday, August 22, 2002 10:41 AM 
To: Ant Users List 
Subject: Re: Can Ant iterate? 

From: "Conor MacNeill" <> 
> 2. Write a Task to do it and the necessary dependency checks, fileset 
> support, etc. Tasks are pretty easy to write and can make your build 
> files clearer. Many tasks are just wrappers for running the java task 
> anyway. The task can be built as part of the build. 

Is it possible to compile a task and then use that task later in the
build script? How would one go about this? 


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message