ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Bridges" <sbrid...@smgtec.com>
Subject RE: getting a macro attribute in a script
Date Sat, 06 Mar 2004 21:25:37 GMT
The problem is I want to use the macro several times, each time with a different config.file
attribute.  This means that I cant use a property.

Is there a way to get at the macro attribute from within the script without using a property?

-----Original Message-----

If you mean you want to set the value of the config_file property then try this

<property name="config_file" value="@{config.file}"/>

but better would be to use the @{config.file} where you need it in the macro and avoid the
property all together.

Remember properties are immutable once set they cannot be reset.

Thanks.  Bill

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716
billrich@wilandra.com or billrich@attglobal.net
http://www.wilandra.com

-----Original Message-----
From: Sean Bridges [mailto:sbridges@smgtec.com]
Sent: Friday, March 05, 2004 5:38 PM
To: user@ant.apache.org
Subject: getting a macro attribute in a script


How do you get the value of a macro's attribute from within a script.

My build file looks like,

            <macrodef name="replaceClientConfig"
id="replaceClientConfig_id">
                        <attribute name="config.file"/>
                        <sequential>
                                    <script language="javascript">

                                                <![CDATA[

                                                //echo =
project.createTask("echo");

//echo.setMessage(replaceClientConfig_id.toString());
                                                //echo.perform();

                                                config_file  = ???


I want to set the config_file variable to the value of the config.file
attribute.

Thanks,

Sean





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


Mime
View raw message