Description
Obtain or set the value of a counter. When used in its base form (where only the counter name is provided), the counter value will be printed to the output stream. When the value is provided, the counter will be set to the value provided. When a property name is provided, the property will be filled with the value of the counter. You may not specify to both get and set the value of the counter in the same Task.
The user performing this task must have Perforce "review" permissions as defined by Perforce protections in order for this task to succeed.
Parameters
Attribute | Description | Required |
name | The name of the counter | Yes |
value | The new value for the counter | No |
property | The property to be set with the value of the counter | No |
Examples
Print the value of the counter named "last-clean-build" to the output stream:
<p4counter name="last-clean-build"/>Set the value of the counter based on the value of the "TSTAMP" property:
<p4counter name="last-clean-build" value="${TSTAMP}"/>Set the value of the "p4.last.clean.build" property to the current value of the "last-clean-build" counter:
<p4counter name="last-clean-build" property="${p4.last.clean.build}"/>