Target or macrodef? 2004-08-25 - By sebastian ssmoller
> > > hi, > > this would be great ! > > > > recently, i had exactly that problem (setting a "temp" property in a > > <macrodef/>) ... i had to use <antcall/> as work-around :( > > > > Well, <antcall> is just totally unnecessary. Just use the value of > the macrodef > attributes as a property. Obviously it becomes a property that will > live > throughout the app, but it is usually so unique that that you'd never > define or > generate another property by the same name. If the value won't be > unique, you > can chain multiple macrodef attribute values together to make a truly > unique > property. For more information, see... > > http://ant.apache.org/faq.html#propertyvalue-as-name-for-property
i disagree - i guess there are of course reasons for using <antcall/> and i guess my example above is one of them.
while ur "solution" or better called "work-around" may work too i would not use it cause THIS is an ugly hack - thats the way unmaintainable code is produced! what u r talking about is "generating" property names and this does definitively makes the code harder to read ... at least IMHO ... what does a generated property name tell about its use or the coders intention ? nothing! i guess the best and obious solution would be to allow some kind of variable scoping in ant.
thx regards, seb
<snip/>
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|