createBuildDefinition

The createBuildDefinition task creates a build definition in the Jazz® repository.

If the specified build already exists, it will be updated with the build property values specified.

The following table describes createBuildDefinition attributes.

Attribute Description Required

repositoryAddress

Address of the team repository to use. The value of this attribute is typically ${repositoryAddress} because that property is built-in when the Jazz Build Engine is used.

Yes

userId

User ID for authentication to the repository. Requires password or passwordFile to be set.

Yes

certificateFile

The path to the file that contains the user's login certificate for authentication. Requires password or passwordFile to be set. You can specify certificateFile or repositoriesFile, but not both.

No

password

Password for the user ID for authentication to the repository. Either password or passwordFile can be provided, but not both.

No

passwordFile

The password file to use for authentication to the connection. You can create a suitable password file by invoking the Jazz Build Engine with the -createPasswordFile argument. Only one password file can be specified. Either password or passwordFile can be provided, but not both.

No

smartCard

Use of the connected smart card for authentication (true or false). Requires userId to be set. For more information about smart card authentication, see Connecting to repositories and project areas.

No

failOnError

If true (default value), the task fails if it encounters an error. If false, some errors are ignored and the task is completed.

No

verbose

More message output. The default value is false.

No

buildDescription

The description for the build that is to be created.

Yes

buildFolder

The build folder path for the build that is to be created. Specify a build folder in the form /parentFolder/folderName. If the specified build folder is not found when the build is created, it will be created.

No

buildId

The ID for the build that is to be created.

Yes

buildWorkspace

The name of the workspace to use as a reference for streams, components, projects and files used by the build and included in the build definition. This does not have to be the workspace that is used by the build, but it can be. It must be a workspace that is attached to the same streams, components, projects, and files used by the build. This workspace is used as the prototype for any workspace defined to the build that is created by the creatBuildDefinition task.

Yes

commaSeparated

This option controls how list items for build properties are specified. Valid values are true and false. If the value is true, a build definition report is generated. If false, list items must be separated by a space. The default value is true.

No

createReport

This option controls whether or not a build definition report is generated. Valid values are true and false. If the value is true, a build definition report is generated. If false, no report is generated. If other reporte attributes are specified and createReport is set to false, no report is generated and the other report attributes are ignored. The default is true.

No

createWorkspace

This option controls whether a build workspace is created for the build when the spcified workspace is not found. Valid values are true and false. If the value is true, the build workspace is created for the build when the specified workspace is not found. If false, a build fails when the specified workspace is not found. The default value is true.

No

ignoreWarnings

Specify true to set the Ignore Warnings when computing overal status option. When ignorewarnings is set to true, build warnings are ignored and Engineering Lifecycle Management will show the build as Passed until a build failure is encountered. Valid values are true and false. The default value is false.

No

processAreaName

The name of the EWM process area where the builds are defined.

When the process area is a child of a parent process area, like a team area, specify the process area name in a path format starting with the project area name ( /project_area_name/team_area_name/subteam_area_name for example).

Yes

processAreaNameDefinitions

The name of the EWM process area where Enterprise Extensions resource definitions used by this build are defined. If not specified, the EWM process area identified by the processAreaName attribute is used. Nevertheless, if the process area is a team area, the EWM process area must be explicitly identified to define where the Enterprise Extensions system definitions are.

No

propertyCopy

This option controls whether or not the property copy process is enabled. Valid values are true and false. If the value is true, all buildPopertyCopy attributes will be processed an new ant properties will be created for those build properties specified by the buildPropertyCopy elements. See the buildPropertyCopy Element section for more information. The default is false.

No

pruning

This option controls whether or not build pruning is enabled. Valid values are true and false. If the value is true, the build pruning policy is enabled. Prunign periodically deletes build results that are not longer needed. The default value is false.

No

prunignFailed

Specify the number of failed builds to keep before pruning takes effect. Pruning periodically deletes build results that are no longer needed. Specify the number of failed build results to keep. Older build results are deleted first. the default value is 10.

No

pruningSuccessful

Specify the number of successful builds to ekep before pruning takes effect. Pruning periodically deletes build results that are not longer needed. Specify the number of successful build results to keep. Older build results are deleted first. The default value is 10.

No

reportAppend

This option controls whether the build definition report is appended to or overwrites the specified report file. Valid values are true and false. If the value is true, the build definition report will be appended to the specified report file. If false, the build definition report will overwrite (replace) the specified report file. The default is false.

No

reportCondensed

Thihs option controls the format of build properties written to the build definition report. Valid values are true and false. If the value is true, each build property will be reported on a single line, displaying only the name and value of the property. If false, each build property will be reported on multiple lines, displaying each attribute of the build property on a line. The default value is false.

No

reportFile

The name of the report file. If a reportFile is specified, the build definition report will be written to the file. If omitted, the build definition report will be written to the build log.

No

reportFolder

The name of the report file folder. This is the location for the report file. A fully qualified path is required.

No

reportNoUuid

This option controls whether or not UUID values are printed. Valid values are true and false. If the value is true, UUID values are printed x-ed out. If false, UUID values are printed as strings. The defualt value is false.

No

reportOnly

Specify true to have createBuildDefinition only create a build report. This option h as been superseded by the reportBuildDefinition tasks and is kept for compatibility purposese only. Valid values are true and false. The default value is false.

No

reportSorted

This option controls whether or not build properties are reported in sorted order in the build definition report. Valid values are true and false. If the value is true, build properties are reported in sorted name order. If false, build properties are reported in random order. The default is false.

No

scheduleEnabled

Specify true to enable build schedules. Valid values are true and false. The default is false.

No

templateId

The template ID or template alias for the build that is to be created. See the Build Reference section for more information on build template IDs or template aliases.

Yes

updateOnly

Specify true to limit the update process to updating existing properties and to avoid automatic property clean up actions. Valid values are true and false. The default is false.

No

See the Build Definition Reference section for more information on defining a build and build properties.

Create build definitions:


<target name="test" description="Create Build Definition">
  
  <xt:createbuilddefinition
    repositoryAddress="${repositoryAddress}"
    userId="${userId}"
    password="${password}"
    buildId="Test.djr.Ant.011"
    buildDescription="Test.djr.Ant.011.Description"
    buildFolder="Test/djr/Ant"
    buildWorkspace="Test.djr.Stream.000.Workspace"
    ignoreWarnings="true"
    processAreaName="${paDJR}"
    pruning="true"
    pruningFailed="50"
    pruningSuccessful="50"
    reportCondensed="false"
    reportFile="Test.djr.Ant.011.txt"
    reportFolder="C:\Users\djreilly\Downloads"
    reportNoUuid="true"
    reportOnly="false"
    reportSorted="true"
    scheduleEnabled="false"
    templateId="com.ibm.team.build.ant">
    
    <!-- Build Engines -->
    <xt:buildEngineDefine id="NASWJBE00"/>
    
    <!-- Jazz Source Control Properties -->
    <xt:teamBuildProperty name="team.scm.acceptBeforeFetch" value="false"/>
    <xt:teamBuildProperty name="team.scm.buildOnlyIfChanges" value="false"/>
    <xt:teamBuildProperty name="team.scm.createFoldersForComponents" value="false"/>
    <xt:teamBuildProperty name="team.scm.deleteDestinationBeforeFetch" value="false"/>
    <xt:teamBuildProperty name="team.scm.fetchDestination" value="${dir.wrk}\${initialize.definition.directoryPrefix}.@compile"/>
    <xt:teamBuildProperty name="team.scm.workspaceUUID" value="Test.djr.Ant.011.Workspace"/>
    
    <!-- Ant Build Properties -->
    <xt:antBuildProperty name="com.ibm.team.build.ant.antArgs" value="${ant.arg} ${ant.com.arguments}"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.antHome" value="${dir.182}"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.buildFile" value="${etc.ant}\InitializationBuildSubmit.xml"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.includeToolkit" value="true"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.javaHome" value="${dir.jdk}"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.javaVMArgs" value="${jvm.arg} ${jvm.com.arguments}"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.propertiesFile" value="${file.buildproperties}"/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.targets" value=""/>
    <xt:antBuildProperty name="com.ibm.team.build.ant.workingDir" value="${etc.ant}"/>
    
    <!-- UrbanCode Deploy Properties -->
    <xt:ucdpBuildProperty name="team.udeploy.abortOnIncompleteActivityEnabled" value="true"/>
    <xt:ucdpBuildProperty name="team.udeploy.application" value="application"/>
    <xt:ucdpBuildProperty name="team.udeploy.baseDirectory" value="${team.scm.fetchDestination}"/>
    <xt:ucdpBuildProperty name="team.udeploy.component" value="component"/>
    <xt:ucdpBuildProperty name="team.udeploy.deployEnabled" value="true"/>
    <xt:ucdpBuildProperty name="team.udeploy.enabled" value="true"/>
    <xt:ucdpBuildProperty name="team.udeploy.environment" value="environment"/>
    <xt:ucdpBuildProperty name="team.udeploy.excludeFiles" value="exclude.000"/>
    <xt:ucdpBuildProperty name="team.udeploy.includeFiles" value="include.000"/>
    <xt:ucdpBuildProperty name="team.udeploy.links" value="links.000"/>
    <xt:ucdpBuildProperty name="team.udeploy.password" value="password"/>
    <xt:ucdpBuildProperty name="team.udeploy.passwordFile" value=""/>
    <xt:ucdpBuildProperty name="team.udeploy.passwordType" value=""/>
    <xt:ucdpBuildProperty name="team.udeploy.process" value="process"/>
    <xt:ucdpBuildProperty name="team.udeploy.properties" value="property.000"/>
    <xt:ucdpBuildProperty name="team.udeploy.serverURI" value="https://localhost:8443/"/>
    <xt:ucdpBuildProperty name="team.udeploy.triggerPolicy" value="ALWAYS"/>
    <xt:ucdpBuildProperty name="team.udeploy.userName" value="djreilly@us.ibm.com"/>
    <xt:ucdpBuildProperty name="team.udeploy.version" value="version"/>
    
    <!-- Jdt Publishing Properties -->
    <xt:jdtBuildProperty name="com.ibm.team.build.jdt.publishing.log" value="jdt.log"/>
    
    <!-- JUnit Publishing Properties -->
    <xt:jntBuildProperty name="com.ibm.team.build.junit.publishing.log" value="junit.log"/>
    
    <!-- Build Properties -->
    <xt:buildProperty name="ant.arg" value="-v" description="Ant invocation arguments" kind="com.ibm.team.build.property.string"/>
    <xt:buildProperty name="ims.build.ant.buildId" value="" description="IMS build initialization ID parameter" kind="com.ibm.team.build.property.string"/>
    <xt:buildProperty name="jvm.arg" value="" description="JVM invocation arguments" kind="com.ibm.team.build.property.string"/>
  </xt:createbuilddefinition>
 
</target>

Create build definitions where the process area is a team area:


<target name="create" description="main">

  <!-- Create build definition -->
  <xt:createbuilddefinition
	repositoryAddress="${repositoryAddress}"
	userId="${userId}"
	password="${password}"
	buildId="${buildDefId}"
	buildDescription="Dependency build description"
	buildWorkspace="${BUILD_WORKSPACE}"
	processAreaName="${projectArea}/${teamArea}"
	processAreaNameDefinitions="${projectArea}"
	templateId="com.ibm.team.enterprise.zos.build.dependency.template">
    
  <!-- Build Engines -->
  <xt:buildengine id="Build agent"/>
			
  <!-- Jazz Source Control Properties -->
  <xt:teambuildproperty name="team.enterprise.scm.acceptBeforeFetch" value="true"/>
  <xt:teambuildproperty name="team.enterprise.scm.buildOnlyIfChanges" value="true"/>
  <xt:teambuildproperty name="team.enterprise.scm.deleteDestinationBeforeFetch" value="false"/>
  <xt:teambuildproperty name="team.enterprise.scm.createFoldersForComponents" value="false"/>
  <xt:teambuildproperty name="team.enterprise.scm.fetchDestination" value="${FETCH_DESTINATION}"/>
  <xt:teambuildproperty name="team.enterprise.scm.resourcePrefix" value="${PREFIX}"/>
  <xt:teambuildproperty name="team.enterprise.scm.workspaceUUID" value="${BUILD_WORKSPACE}"/>
  <xt:teambuildproperty name="teamz.scm.workspaceUUID" value="${BUILD_WORKSPACE}"/>		
				
  <!-- Ant with Enterprise Extensions Configuration -->
  <xt:dpndbuildproperty name="team.enterprise.build.ant.antArgs" value="-verbose"/>
  <xt:dpndbuildproperty name="team.enterprise.build.ant.javaVMArgs" value="-Xquickstart"/>
  </xt:createbuilddefinition>
		
</target>