The macro returns the input command response in a parseable format by removing all line breaks, as well as, the first matched group as defined by the specified regex pattern.
The following table describes the macro specific attributes for the macro:
| Macro Specific Attributes | ||
| Attribute | Description | Required |
| default | The default value to return in the property when regex does not find a match. This attribute is optional. If omitted, and regex does not find a match, the returned value will be empty. | No |
| input | The name of a property in which to store the parseable result. | Yes |
| property | The name of a property in which to store the first match group from the regex result. | Yes |
| value | The input command response. | Yes |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed Materials - Property of IBM
(c) Copyright IBM Corporation 2020. All Rights Reserved.
Note to U.S. Government Users Restricted Rights:
Use, duplication or disclosure restricted by GSA ADP Schedule
Contract with IBM Corp.
-->
<project
basedir="."
default="all"
name="Example"
xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
<description>Example</description>
<!-- Load build extensions -->
<xt:loadBuildExtensions/>
<xt:getJarLocation property="jarPath"/>
<!-- Load common resources -->
<import>
<javaresource name="scripts/smpe/imports/$common.xml">
<classpath location="${jarPath}"/>
</javaresource>
</import>
<!-- - - - - - - - - - - - - - - - - - - *
* Example *
*- - - - - - - - - - - - - - - - - - - -->
<target name="main" description="main">
<echo level="info">Scm Checkin</echo>
<BuildActivityStartChild label="${lblTermParent}.Checkin" parent="${termParentId}"/>
<ScmCheckin property="propertiesCheckinResponse" directory='"${team.scm.fetchDestination}"'/>
<echo level="info">Scm ChgUUID</echo>
<BuildActivityStartChild label="${lblTermParent}.ChgUUID" parent="${termParentId}"/>
<GetResponseProperty property="propertiesCheckinUUID" value="${propertiesCheckinResponse}" input="propertiesCheckinResponseValue" regexp="Change sets\:.*\(([^)]+)\)" default="none"/>
</target>
<target depends="main" description="all" name="all"/>
</project>