----- Original Message ----- From: "James Duncan Davidson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 02, 2001 5:09 PM Subject: Re: Need if/unless features
> On 12/29/00 4:36 AM, "Peter Donald" <[EMAIL PROTECTED]> wrote: > > > Agreed - this is a problem ant2.0 will address hopefully. Many people have > > asked for it in one way or another ... What I suggest is something like > > > > <target name="t1" depends="t2"/> > > <target name="t2" if="execute.t2"/> > > > > <target name="t1" if="execute.t1"> > > <ant-call target="t1"/> > > </target> > > > > It is not efficient or pretty but it does work ;) > > Um, do you really mean to define the same target twice? That doesn't flow > very well. > > The way that I think it should be solved is via a "execute-target" task. > > <target name="main"> > <execute-target name="foo" if="property.foo"/> > </target> > > <target name="foo" depends="bar, bap">..</target> > > Having it as just a task means that nothing else gets done unless the > property is set to 1 or true. > The <execute-target> task is good, probably the most succinct way to solve a lot of different requests/problems. It should be augmented, however, with "else", "or", "and", "not" functionality. It would certainly be a benefit, though, above the current <antcall> task, which has the shortcoming that it behaves as a new project, for which any newly set properties that get set don't persist once the antcall task is completed.... Jason
