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

Specifies more message output. The default 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>

video icon Video

Jazz.net channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community

Jazz.net
Jazz.net forums
Jazz.net library

support icon Support

IBM Support Community
Deployment wiki