The parellel would cause grief.
The problem is not the attribute, I think
but the "newcurrent" global "variable".
On using macrodef, I have noticed that
it would be really cool to have a static scopped
variable.
Peter
On Thursday 16 October 2003 21:32, Shatzer, Larry wrote:
> I have run into a possible bug when working with macrodef and parallel in a
> recursive situation.
>
> The following build file snip example exhibits this: (This requires the
> <if> ant-contrib task, and <math> from Antelope, soon to be ant-contrib).
>
> <macrodef name="recurse">
> <attribute name="until"/>
> <attribute name="current"/>
> <attribute name="met -->
hod"/>
> <sequential>
> <if>
> <equals arg1="${until}" arg2="${current}"/>
> <then>
> <echo message="Method: ${method} done"/>
> </then>
> <else>
> <math
> datatype = "int"
> operand1 = "${current}"
> operand2 = "1"
> operation = "+"
> result = "newcurrent"
> />
> <echo
> message = "1: M: ${method}, C: ${current}, U: ${until}"
> />
> <sleep seconds="1"/>
> <echo
> message = "2: M: ${method}, C: ${current}, U: ${until}"
> />
> <recurse
> current = "${newcurrent}"
> method = "${method}"
> until = "${until}"
> />
> </else>
> </if>
> </sequential>
> </macrodef>
>
> <target name="test">
> <parallel>
> <recurse current="0" method="0" until="5"/>
> <recurse current="0" method="1" until="10"/>
> <recurse current="0" method="2" until="15"/>
> <recurse current="0" method="3" until="20"/>
> </parallel>
> </target>
>
> Depending on the situation, this could result in an endless loop.
>
> I use something similar to this method when checking out/updating a list of
> cvs projects in parallel, and ran across the methoddef's steeping on each
> others toes. I was converting from using antcall to macrodef.
>
> I don't know how to handle this, since macrodef should be able to set and
> read properties in a global context, but sometimes you want local
> variables. Maybe add a flag to <attribute> of global/local?
>
> -- Larry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]