Scott, In your example the "if" part of the wrapper is redundant, since all the depends have the same "if" attribute. It would work just the same, but removing the "if" part of the wrapper would allow the build to run some targets regardless. Excellent example. Just adding my 2 cents, -Rob Anderson -----Original Message----- From: Scot P. Floess [mailto:floess@mindspring.com] Sent: Friday, December 14, 2007 6:38 AM To: Ant Users List Subject: Re: How to conditionally run a group of targets? Cyril: Sorry, was on my way to bed when I responded... I probably should have tried an example... I think Jan pointed out something like below... Cyril Sagan wrote: > Scott - Thanks for the response, but that doesn't work. > > The "A,B,C,D" depends targets will be executed first, it is only the body of "wrapper" that's conditional based on the property. > > I'm still looking for an elegant solution. > > --Cyril > > ________________________________________ > From: Scot P. Floess [floess@mindspring.com] > Sent: Thursday, December 13, 2007 9:46 PM > To: Ant Users List > Subject: Re: How to conditionally run a group of targets? > > Why don't you try this... > > > > The point is, the depends attribute acts as your grouping ;) > > Cyril Sagan wrote: > >> Our build script needs to run an arbitrary *group* of targets based on >> a single property. Can you help me find a clean way to do this? >> >> Here's an "almost solution" which illustrates what I'd like to >> accomplish: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> This does not work. The problem is that any properties set in the >> 'd targets will not be visible in the calling environment. >> Targets A,B,C,etc -- not all of which I control, so I cannot >> restructure -- may have side effects, setting state in properties that >> I need to have access to. >> >> Regarding the " almost solution", I see that there are ways >> to pass properties "down to" , but I do not know of a clean >> way to "pass back". I found a year+ old question on ant-dev asking >> about this, but never saw an answer. >> >> In any case, we aren't set on using (enhancing?) , it was >> just close to a solution. >> >> Goal is to group the set of targets. I'm hoping to find a solution >> less awkward than this: >> >> >> >> >> >> Thanks for any suggestions. >> >> --Cyril >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >> For additional commands, e-mail: user-help@ant.apache.org >> >> >> >> > > -- > Scot P. Floess > 27 Lake Royale > Louisburg, NC 27549 > > 252-478-8087 (Home) > 919-754-4592 (Work) > > Chief Architect JPlate http://sourceforge.net/projects/jplate > Chief Architect JavaPIM http://sourceforge.net/projects/javapim > QA Engineer OpenQabal http://openqabal.dev.java.net > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > > -- Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-754-4592 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim QA Engineer OpenQabal http://openqabal.dev.java.net --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org