ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <ca...@us.ibm.com>
Subject Re: Using properties like variables
Date Wed, 14 Dec 2005 15:38:10 GMT
There has been a fair amount of discussion on the developer list about 
providing scoped properties for macrodefs, but I'm not sure where we are 
on that.

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


<Paulo.Pinto@nokia.com> wrote on 12/14/2005 09:53:47 AM:

> Hi everyone,
> 
> I know that properties can't be used
> as variables. However I'm trying to
> implement something where I would like
> to have a behaviour similar to that.
> 
> For example, let's imagine for a second
> that properties aren't immutable, and
> create the following macro
> 
> <macrodef mymacro="name">
>    <attribute name="arg1"/>
>    <attribute name="arg2" default=""/>
>    <sequencial>
>      <!-- if arg2 != "" set var=arg1/arg2 else var=arg1-->
> 
>      <!-- just use var in all required places -->
>    </sequencial>
> </macrodef>
> 
> My problem is that if this macro is called more that
> once, "path" will always have the first value it was
> set to.
> 
> I can understand the behaviour because this is how
> properties work.
> 
> Is there a way of somehow having properties that are
> local to the macro definitions?
> 
> Thanks,
> Paulo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message