This is less useful than it might appear, because anything in a 'depends' is only run once per execution regardless of the conditional's value. So using your example, if you are running multiple targets that require the conditional processing of say t1, t1 will run 1 or 0 times regardless of the value of c1.
All I am saying is that your two examples are not functionally the same. With task level if's I can conditionally execute task/target multiple times in one run, with depends alone, I can't. -alan Jose Alberto Fernandez wrote: > Just to cut to the chase, what Peter is trying to say is that instead of > asking for: > > <target name="A" depends="B,C"> > <task1 if="c1" /> > <task2 if="c2" /> > </target> > > the way to do this in ANT is: > > <target name="A" depends="B,C,t1,t2" /> > > <target name="t1 if="c1" > <task1> </target> > <target name="t2" if="c2" > <task2> </target> > > That's it. > > > -----Original Message----- > > From: Daniel Barclay [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, May 15, 2001 4:23 PM > > To: [EMAIL PROTECTED] > > Subject: Re: if and unless attributes for all Tasks > > > > > > Peter Donald wrote: > > > > > > At 01:04 14/5/01 -0400, Daniel Barclay wrote: > > > >> If you need it, wrap it in a target. > > > > > > > >That won't work well if you want different tasks within one target > > > >to have different conditions. > > > > > > If you have that then you misunderstand the notion of targets ;) > > > > I don't think so, but what you do mean? > > > > You don't think one might want to configure how a target is executed > > by parameterizing tasks with boolean values similarly to how we > > parameterize tasks with string values? > > > > Daniel > > -- > > Daniel Barclay > > Digital Focus > > [EMAIL PROTECTED] > >
