getNextMacroCounter

The getNextMacroCounter task returns the next integer value of the macro counter.

It is thread safe ad will always return a unqiue next integer value for the life of the build.

The following table describes getNextMacroCounter attributes.

Attribute Description Required

property

The name of the Ant property in which to return the workspace name.

Yes

verbose

More message output. The default value is false.

No

Note:
  • This task can be used to create unique property names in macros.
  • This property specified for the returned value can be reused.

Example

Create a uniquely named property


<macrodef name="NesProperty">

	<attribute name="country"/>
	<attribute name="name"/>
	<attribute name="value"/>
	<sequential>
		<property name="@{name}.@{counter}" value="@{value}"/>
	</sequential>
</macrodef>

<target name="main">
	<im:getnextmacrocounter property="current"/>
	<NewProperty counter="${current}" name="my.property" value="my.value"/>
</target>