ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Rich" <billr...@attglobal.net>
Subject RE: getting a macro attribute in a script
Date Sat, 06 Mar 2004 16:13:28 GMT
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