ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fei Sha <Fei....@prism.uvsq.fr>
Subject Re: Newbie question, recursive task invocation
Date Tue, 16 Jul 2002 08:28:45 GMT


sorry, the previous message is incomplete

Thanks Diane for the response. I was looking for a simple way to
do a sequence of tasks. Now that I looked closer at what I really need.
I'm afraid I need to write my own tasks.

what I need/trying to do is:

1. A TaskContainer that holds some java objects to be shared by
some specific tasks.

2. These specific tasks:
         a. share the objects hold by the TaskContainer
         b. can be executed in any combination/order.

3. The whole TaskContainer is executed against
the contents of each sub-directory (I use a MatchingTask to get the
list of the sub-dirs and repeat the execution of the taskContainer in
each sub-dir).


Now I write the TaskContainer class and some Task classes. All shared objects
are created at the Container initialization time. The tasks then use 
getOwnerTarget()
to reach the TaskContainer and cast it to a specific interface to access 
the shared objects.

Now I have a problem. If I define the tasks in the build.xml file with 
<taskdef>, the tasks
do not have the same classloader thus they can not cast the TaskContainer.

For now I put all the specific taskdefs in a resource file and load the
task definitions when executing the TaskContainer. This time the tasks
have the same class loader than the TaskContainer but, I still need to declare
the tasks in build.xml so that ant doesn't complain task not found.

Is there a better solution to do this?

Thanks!

Fei
   


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


Mime
View raw message