ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: <macrodef> and local
Date Mon, 21 Jun 2004 13:16:42 GMT
On Mon, 21 Jun 2004, Jose Alberto Fernandez
<jalberto@cellectivity.com> wrote:
>> From: Stefan Bodewig [mailto:bodewig@apache.org] 
>
>> The main limitation I see without local properties in <macrodef> is
>> when your macro uses a property setting task like <basename> or
>> <available> - you currently need to provide a unique property name
>> to those tasks if you want to reuse the macro.
> 
> Is this really the only reason, currently, for local properties?

Not the only, but a very important one.

> Because if that is the case, maybe we can solve the problem in a
> completely different way, which is specific to <macrodef/>.

What you describe is pretty much what I (and probably anybody else)
use as a workaround.  I create what would be a local property by using
a name contains the name of at least one of the task's attributes.

I don't think I'd like to turn this into a formalized solution with
the property namespace polution you get.  Also, you can't guarantee
unique property names since you don't know which normal Ant property
names will be used later in the build - outside of <macrodef>s.  All
you could guarantee is that the name hasn't been used yet and won't
clash with a name a <let> construct would create later.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message