Matt, just a note that there is a small typo in the code you posted.
The processing of the "if" clause is busted when you use an '|'
operator. I'd post a patch, but I've modified what you posted to fit
our coding standards and into our project, so I'll just post the code
change since it's short.
The original :
if( op.equals("&") )
performCall = performCall && propBool;
else if( op.equals("|") )
performCall = performCall && propBool;
else
throw new BuildException("Bad operation: " + op);
I changed the handling of the op.equals("|") from using "&&" to "||":
if( op.equals("&") )
performCall = performCall && propBool;
else if( op.equals("|") )
performCall = performCall || propBool;
else
throw new BuildException("Bad operation: " + op);
[EMAIL PROTECTED] wrote:
>
> 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)
>
> ------------------------------------------------------------------------
> Name: CallTarget.java
> CallTarget.java Type: java/*
> Encoding: base64
--
Larry V. Streepy, Jr.
Chief Technical Officer and VP of Engineering
Health Language, Inc. -- "We speak the language of healthcare"
970/626-5028 (office) mailto:[EMAIL PROTECTED]
970/626-4425 (fax) http://www.healthlanguage.com