escapeProperty

The escapeProperty task escapes property values imbedded in build properties.

The escapeProperty task can be invoked prior to the propertyfile task to prepare imbedded properties in the specified value before the value being written to the property file. The resulting property file might be passed through various builds without losing the imbedded property designations in value. The unEscapeProperty task is used to restore imbedded property designations at the appropriate time.

The following table describes escapeProperty attributes.

Attribute Description Required

chars

Specifies a proprety escape string. All instances of "${" will be changed to the value specified by chars. The chars attribute is optional. The default escape string is "\$\{".

No

name

Name of the ant property whose value is to be escaped. The value of this property will be updated with all instances of "${" changed to the escape string.

Yes

verbose

More message output. The default value is false.

No

Note: The escapeProperty/unEscapePropety tasks are used together to pass property values with imbedded properties to another build using the ant propertyfile task and the Build Toolkit's requestTeamBuild task using the overridePropertiesFile attribute.

Example

Pass build properties to another build


<!-- Update build properties -->
<im:createbuilddefinition
	repositoryAddress="${repositoryAddress}"
	userId="${repositoryusername}"
	buildId="${buildId}"
	buildWorskapce="${workspaceName}"
	ProcessAreaName="${processAreaName}"
	updateOnly="true"
	updateProperties="true"

	<!-- Jazz Source Control Properties -->
	<im:teambuildproperty name="team.enterprise.scm.acceptBeforeFetch"		  value="false"/>

	<!-- z/OS Dependency Build Properties -->
	<im:dpndbuildproperty name="team.enterprise.build.ant.usegenerateBuildFile" value="false"/>
	<im:dpndbuildproperty name="team.enterprise.build.ant.buildFile"			value="$${etc.ant}/InitializationMacrodefs.xml"/>
	<im:teambuildproperty name="team.enterprise.build.ant.preBuildFile"		 value="$${etc.ant}/InitializationMacrodefsPreBuild.xml"/>
	<im:teambuildproperty name="team.enterprise.build.ant.postBuildFile"		value="$${etc.ant}/InitializationMacrodefsPostBuild.xml"/>

	<!-- Ant with Enterprise Extension Configuration -->
	<im:dpndbuildproperty name="team.enterprise.build.ant.antArgs"			  value="$${ant.arg} $${ant.com.arguments}"/>
	<im:dpndbuildproperty name="team.enterprise.build.ant.javaVMArgs"		   value="$${jvm.arg} $${jvm.com.arguments}"/>
	
	<!-- z/OS Dpendency Build Optins Properties -->
	<im:dpndbuildproperty name="team.enterprise.build.ant.buildAllItems"		value="true"/>
	<im:teambuildproperty name="team.enterprise.build.ant.buildableSubset"	  value=""/>
	<im:teambuildproperty name="team.enterprise.build.ant.buildChangesOnly"	 value="false"/>

	<!-- Build Engines -->
	<im:buildengine id="NASWRBA0S"/>
	<im:deletebuildengine id="NASWBFA00"/>
</im:createbuilddefinition>

<!-- Escape build properties -->
<im:escapeproperty name="ims.build.ant.updateProperty.acceptBeforeFetch"/>
<im.escapeproeprty name="ims.build.ant.updateProperty.antArgs"/>
<im.escapeproperty name="ims.build.ant.updateproperty.buildAllItems"/>
<im.escapeproperty name="ims.build.ant.updateproperty.buildChangesOnly"/>
<im.escapeproperty name="ims.build.ant.updateproperty.buildFile"/>
<im.escapeproperty name="ims.build.ant.updateproperty.buildableSubset"/>
<im.escapeproperty name="ims.build.ant.updateproperty.javaVMArgs"/>
<im.escapeproperty name="ims.build.ant.updateproperty.postBuildFile"/>
<im.escapeproperty name="ims.build.ant.updateproperty.preBuildFile"/>
<im.escapeproperty name="ims.build.ant.updateProperty.useGeneratedBuildFile"/>

<!-- Delete properties file -->
<delete file="${overridePropertiesFile}" quiet="true"/>

<!-- Create properties file -->
<propertyfile file="${overridePropertiesFile}" comment="Override properties for ${buildId}">
	<entry key="ims.build.ant.buildId" value="${buildId}"/>
	<entry key="ims.build.ant.processAreaName" value="${processAreaName}"/>
	<entry key="ims.build.ant.submitBuildId" value="${buildDefinitionId}"/>
	<entry key="ims.build.ant.workspaceName" value="${workspaceName}"/>
	<entry key="ims.build.ant.updateProperty.acceptBeforeFetch" value-"${ims.build.ant.updateProperty.acceptBeforeFetch}"/>
	<entry key="ims.build.ant.updateProperty.antArgs" value="${ims.build.ant.updateProperty.antArgs}"/>
	<entry key="ims.build.ant.updateProperty.buildAllItems" value="${ims.build.ant.updateProperty.buildAllItems}"/>
	<entry key="ims.build.ant.updateProperty.buildChangesOnly" value="${ims.build.ant.updateProperty.buildChangesOnly}"/>
	<entry key="ims.bulld.ant.updateProperty.buildFile" value="${ims.build.ant.updateProperty.buildFile}"/>
	<entry key="ims.build.ant.updateProperty.buildableSubset" value="${ims.build.ant.updateProperty.buildableSubset}"/>
	<entry key="ims.build.ant.updateProperty.javaVMArgs" value="${ims.build.ant.updateProperty.javaVMArgs}"/>
	<entry key="ims.build.ant.updateProperty.postBuildFile" value="${ims.build.ant.updateproperty.postBuildFile}"/>
	<entry key="ims.build.ant.updateProperty.preBuildFile" value=""${ims.build.ant.updateproperty.preBuildFile}"/>
	<entry key="ims.build.ant.updateProperty.useGenerateBuildFile" value="${ims.build.ant.updateProperty.useGeneratedBuildFile}"/>
</propertyfile>

<!-- Submit update build -->
<RequestTeamBuildOverride id="${buildId}" overridePropertiesFile="${overridePropertyFile}'/>