-100 :-\ IMHO, if/unless in targets are one of the worst features we have in the ANT language. I have to maintain a very large buildprocess and when I had to do everything with target/(@if|@unless) it was a complete nightmare to maintain. In particular since you have to polute your environment with properties whose only reason to exist is to be able to put them in the target attribute. If you have a complex condition, BANG you need a new property to keep track of the condition. And this properties stay arround poluting the build.
Alternatively, you could use <if/> from antcontrib. You can write conditions as complex as you may want and evaluate them without requiring polution of the property space. Everything you can do with target/@if or target/@unless, can be done with <if/> and much more. <if/> does not make ANT more procedural than whatever else we have in ANT. Every declarative language on existance (AFAIK) has <if/>. If there is anything we should do, is accept this and promote <if/> and some other antcontrib constructs into the core. The only place I see a reason for @if or @unless is to decorate inner elements of tasks, like we do in <fileset> <exclude ... if="..."/> </fileset>. This is the only kind of usage that I think should be more pervasive across ANT. I should be able to hide/show any subelement of the build (it would be treated like a coment) based on the evaluation of such attribute. And this should be done by ProjectHelper itself, the task do not need to know anything about it. Something like: <elementA> ..... <elementQ ant-include:if="propertyQ"> <elementT>....</elementT> </elementQ> <elementR ant-include:unless="propertyR"/> ..... <elementA> In the above, if propertyQ is not defined, then elementQ and is children (elementT) will be treated as not there at all, by ProjectHelper. Jose Alberto > -----Original Message----- > From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED] > Sent: 05 May 2004 01:26 > To: Ant Developers List > Subject: Re: ANT 1.7 features suggestion > > > Could you please also update if and unless to accept a list > of properties? > > - Alexey. > > Sullivan, Sean C - MWT wrote: > > >+1 > > > > > > > >>-----Original Message----- > >>From: Anthony Goubard [mailto:[EMAIL PROTECTED] > >> > >>A few weeks ago, there was a discussion about the new > features in ANT > >> > >> > >1.7. > > > > > >>[...] > >> > >> 1) Integrate if and unless at the Task level. > >>This would allow all ANT tasks to have the if and unless attribute > >> > >> > >(the > > > > > >>same way that it has an id attribute). > >>So far the only way to do it is by using <target> except if you use > >> > >> > >one > > > > > >>of the task which has already the "if" "unless" attributes such as > >> > >> > ><fail>. > > > > > >>I think ANT users would use this feature to remove some tartget > >> > >> > >created > > > > > >>only for the purpose of the "if" or would remove the > ant-contrib <if> > >>task. > >> > >> > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]