> <?xml version="1.0" encoding="utf-8"?> > > <project name="ant_dev_problem" default="build"> > <scriptdef name="beanSetProperty" language="beanshell"> > <!-- setProperty appears *not* to respect Ant's property, > immutability. Appears to be a change in 1.7.0. > Note that setNewProperty *does* respect immutability --> > <attribute name="name"/> > <attribute name="value"/> > <![CDATA[ > String n = attributes.get("name"); > String v = attributes.get("value"); > project.setProperty(n, v); > ]]> > </scriptdef> > > > > <macrodef name="a"> > <attribute name="module"/> > <sequential> > <beanSetProperty name="myvalue" value="@{module}" /> > <echo>inside macro: ${myvalue}</echo> > > </sequential> > </macrodef> > > <target name="build"> > <a module="venus"/> > <echo>outside macro: ${myvalue}</echo> > <a module="mars"/> > <echo>outside macro: ${myvalue}</echo> > </target> > </project> > > $ ant -q > [echo] inside macro: venus > [echo] outside macro: venus > [echo] inside macro: mars > [echo] outside macro: mars > > BUILD SUCCESSFUL > Total time: 0 seconds
Your solution works only on sequential processing. If I run the task in parallel, I get unexpected result: <target name="build"> <parallel> <a module="venus"/> <echo>outside macro: ${myvalue}</echo> <a module="mars"/> <echo>outside macro: ${myvalue}</echo> </parallel> </target> -- Best regards, Chau Chee Yang E Stream Software Sdn Bhd URL: www.sql.com.my SQL Financial Accounting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]