On 06/18/2001 08:26:42 PM "Larry V. Streepy, Jr." wrote:
>
> Does anyone have a version of the antcall task that is not so heavy
> weight? Currently (build 1.3), antcall creates an "ant" task, which in
> essence creates a new project.
I wrote a task which does this. It basically calls the specified target
without creating an entirely new Project.
>
> The problem that I'm running into is that important data like
> replacement tokens are *not* being copied into the new project.
Thats one of the reasons I did this =) Actually, my main reason was that
changes I made to tokens/patternsets/etc in the called target did not get
propagated back up to the parent.
>
> directly call the indicated task? I know that this may lead to issues
> with the param management, but I'll deal with those if someone has a
> framework started.
I handle params reasonably well in this task.. My main problem with it is
that it breaks the dependency chaining a bit - I handle the depends
attrbiute in the called target, but if those targets are also depended on
my some other target called before/after this one, the depended targets
will end up getting called multiple times.
I also allow *very simple* logic in determining if a target gets called,
and an elsetarget for when you want if/else behavior in calling targets.
Task is attached below, its short on documentation though, but we all know
code is self documenting, right? =)
Matt
(See attached file: CallTarget.java)
CallTarget.java