ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <Richard.Hens...@McKesson.com>
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> 

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

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

Richard Hensley 

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


From: "Conor MacNeill" <conor@cortexebusiness.com.au> 
> 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
same 
build script? How would one go about this? 

Thanks, 
Gordon 



-- 
To unsubscribe, e-mail:   <
mailto:ant-user-unsubscribe@jakarta.apache.org
<mailto:ant-user-unsubscribe@jakarta.apache.org> > 
For additional commands, e-mail: <
mailto:ant-user-help@jakarta.apache.org
<mailto:ant-user-help@jakarta.apache.org> > 


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