ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: local properties note WAS PropertySet use in macro
Date Wed, 01 Sep 2004 20:26:41 GMT
I take Dominique's hardline stance as positive. The last thing I would
want is a hack to the ant core. Besides, he hasn't called me any names,
yet.

I don't think <local> is the solution either, because that provides
local scope for properties SET in the macro. I don't want to set any
properties. I just want to access the properties in a given propertyset.
And if there is a mapper specified, I want to access the properties by
their mapped name.

I wrote the following to get my by until someone comes up with something
better. It allows me to access the properties in my macro using
$(@{refid}:property}.

   <scriptdef name="copypropertyset" language="javascript">
      <attribute name="refid"/>

      <![CDATA[
        refId      = attributes.get("refid");
        properties = project.getReference(refId).getProperties();

        for (keys = properties.propertyNames(); keys.hasMoreElements();)
{
           oldkey = keys.nextElement();
           newkey = refId + ":" + oldkey;
           project.setProperty(newkey, properties.getProperty(oldkey));
        }
      ]]>
   </scriptdef>

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Wednesday, September 01, 2004 3:11 PM
To: Ant Users List
Subject: local properties note WAS PropertySet use in macro


--- Dominique Devienne <DDevienne@lgc.com> wrote:
> The fact that you can do something doesn't mean we
> should
> be doing it. Whatever you are trying to do you think
> needs
> such a hack, you'd better consider writing custom
> tasks for.

That's awfully hardline.  :)  One thing that did occur
to me that is kind of a negative is that the
<propertyset> is not a child of <macrodef>, but a
child of the MacroInstance.

This brings me back to local properties.  So when (!)
the <local> patch goes in, an optional usage could be
to omit the name and value attributes, instead
specifying a <propertyset>.  This would only make
sense with a <mapper>, but wouldn't hurt anything
without.

Now, then...

-Matt


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
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


Mime
View raw message