Running IBM i System definitions generator Ant tasks

Use the IBM® i system definitions generator to run the following custom Ant tasks. Each task name represents the Java™ class name that implements the task.

InitTask

About this task

InitTask is a custom Ant task that initializes connections with the server for other system definition tasks. The InitTask must run before any other system definition tasks. You can specify the repository address, user ID, password or password file, and project area as attributes. If you do not specify those attributes, the InitTask retrieves them from the file sharing information in the build XML file.
Table 1. InitTask attributes
Attribute Description
repositoryAddress URL string to the Jazz™ Team Server
userid Jazz user ID
password Jazz password
passwordFile Jazz password file
projectArea The name of the project area where associated system definitions are stored.

Example

The following is an example of an InitTask:

<ld:init
    repositoryAddress="${repositoryAddress}"
    userId="${userId}"
    password="${password}"
    projectArea="${projectArea}"
/>

ResDefTask

About this task

Perform this task to create a resource definition, which is the same as a library definition on IBM i.
Table 2. ResDefTask attributes
Attribute Description
name Resource definition name
description Resource definition description
resourcename Name of the resource that is identified by the resource definition.
usagetype Usage of this resource definition. Specify one of the following values:
0
A source of an object library
1
An existing library
nonImpacting Specifies that changes to this system definition do not force Rational Team Concert™ dependency build request processing to use full analysis instead of change set analysis. The default is False.

Example

The following is an example of a ResDefTask:

<ld:resdef name="sourceLibrary"
    description="my load library"
    resourcename="SRCL"
    usagetype="0"/> />

<ld:resdef name="objectLibrary"
    description="my object library"
    resourcename="OUTL"
    usagetype="0"/>

SearchPathTask

About this task

Perform this task to create a search path, which is a list of resource definitions.
Table 3. SearchPathTask attributes
Attribute Description
name Search path name
description Search path description
objectlibrary Name of the object library. If objectlibrary is set to an empty string, the object library property in the i Project is used as the default value. If no object library property is set in the i Project, the first library of the resourcedefinitions attribute is considered as the object library.
sourcelibrary Name of the source library. If sourcelibrary is set to an empty string, the source library property in the i Project is used as the default value. If no source library property is set in the i Project, the second library of the resourcedefinitions attribute is considered as the source library.
resourcedefinitions A string that contains the names of other libraries to search, delimited by commas
nonImpacting Specifies that changes to this system definition do not force Rational Team Concert dependency build request processing to use full analysis instead of change set analysis. The default is False.

Example

The following is an example of a SearchPathTask:

<ld:searchpath name="searchPath"
    description="Search Path"
    objectlibrary="objectLibrary"
    sourcelibrary="sourceLibrary"
resourcedefinitions="additionalLibrary1,additionalLibrary2"/>

TranslatorTask

About this task

Perform this task to create a translator.
Table 4. TranslatorTask attributes
Attribute Description
name Translator name
description Translator description
commandifobjectexists A command to be run when the output object exists
commandifobjectdoesntexist A command to be run when the output object does not exist
searchpath The name of a search path to use with the translator. If a search path with the name does not exist, the name is considered to be a build property. If this attribute is not specified, the search path defaults to ${com.ibm.team.enterprise.ibmi.build.searchPath}.
outputtype The type of the output
outputNameKind The type of output name. Specify one of the following values:
  • SAME_AS_INPUT. This value is the default.
  • USE_PATTERN
  • USE_VARIABLE
outputName The output name string. When outputNameKind is SAME_AS_INPUT, the build ignores it. When outputName is USE_PATTERN, the build uses the pattern string that you specified. When outputName is USE_VARIABLE, it indicates the name of a variable whose value is used as a pattern.
nonImpacting Specifies that changes to this system definition do not force Rational Team Concert dependency build request processing to use full analysis instead of change set analysis. The default is False.
The translator task can have a VariableType data type as an enclosed element.
VariableType can have following attributes for specifying variables for the translator:
Attribute Description
name Variable name
value Variable value

Example

The following are examples of a TranslatorTask:

<ld:translator name="DSPF" description=""
    commandifobjectexists="CRTDSPF SRCFILE(&L/&F) SRCMBR(&N) FILE(*CURLIB/&N) OPTION(*EVENTF)"
    commandifobjectdoesntexist="CRTDSPF SRCFILE(&L/&F) SRCMBR(&N) FILE(*CURLIB/&N) OPTION(*EVENTF)"
    searchPath="mySearchPath"
    outputtype="*FILE">
</ld:translator>

<ld:translator name="DSPF" description=""
    commandifobjectexists="CRTDSPF SRCFILE(&L/&F) SRCMBR(&N) FILE(*CURLIB/&N) OPTION(*EVENTF)"
    commandifobjectdoesntexist="CRTDSPF SRCFILE(&L/&F) SRCMBR(&N) FILE(*CURLIB/&N) OPTION(*EVENTF)"
    searchPath="${my.build.property}"
    outputtype="*FILE">
</ld:translator>

LangDefTask

About this task

Perform this task to create a language definition. LangDefTask accepts scopedProperty as a child element.

The runtime code assumes that any name you specify in the translators attribute is the name of a translator. When you do not specify a translator name, the runtime code treats the translator name as a build property. You must define the build property in the associated build definition so that it points to a specific translator.

You can specify more than one translator in the translators attribute by using a comma (,) as a delimiter.

Table 5. LangDefTask attributes
Attribute Description
name Language definition name
description Language definition description
translators Names of translators or build properties
conditions A comma-separated list of conditions that correspond to the translators attribute. If a translator does not have a condition, its entry in the comma-separated list is blank. If no translators have conditions, there is no need to specify this attribute.
defaultpatterns Associated default file name patterns
languageCode Language code for the language definition.
nonImpacting Specifies that changes to this system definition do not force Rational Team Concert dependency build request processing to use full analysis instead of change set analysis. The default is False.

LangDefTask can have dependencyType, scannerType, scopedProperty, or all three as enclosed elements.

Table 6. dependencyType task attributes
Attribute Description Required
name Dependency type name yes
translators Names of translators, delimited by commas, to be used for analyzing dependencies for this type. If omitted, the runtime code assumes all translators that are defined for the language definition are used. no
Table 7. ScannerTypes task attributes
Type Description
name Scanner name
Table 8. scopedProperty attributes
Attribute Description Default
name Name of the property  
value Value of the property  
condition The Ant condition string, written in escaped XML, that must evaluate to true for the property to be available at runtime.
Note: The condition attribute is optional.
 

Example

The following is an example of a LangDefTask with nested <dependencytype> tags.

<ld:ld:langdef name="Build_RPG_Modules" translators="RPGLE" defaultpatterns=".+\.RPGLE"
languagecode="RPGLE" >
    <ld:dependencytype name="RPGLE COPY" translators="RPGLE"/>
<ld:dependencytype name="RPG External File" translators="RPGLE"/>
<ld:dependencytype name="RPG External Data" translators="RPGLE"/>
<ld:dependencytype name="RPGLE SQL INLCUDE" translators="RPGLE"/>
<ld:dependencytype name="RPG COPY" translators="RPGLE"/>
<ld:dependencytype name="RPG SQL INLCUDE" translators="RPGLE"/>
<ld:scanner name="com.ibm.teamp.ibmi.metadata.scanner.RPGLE"/>
</ld:langdef>
<ld:langdef name="RPG_Include_Files(no_translators)" translators="" languagecode="RPGLE">
</ld:langdef>

The following is an example of a LangDefTask with the condition attribute and scopedProperty element, where its first translator is conditional and it contains a conditional property named 'prop1':

<ld:langdef conditions="&lt;equals arg1=&quot;true&quot; arg2=&quot;${myProp}&quot;/&gt;,," defaultScanner="false" defaultpatterns="bms" languageCode="ASM"
            name="BMS map processing"
            translators="BMS map processing (copybook generation),BMS map processing (object deck generation),Link-edit">  
   <ld:scopedProperty condition="&lt;equals arg1=&quot;a&quot; arg2=&quot;b&quot;/&gt;" name="prop1" value="val1"/>
</ld:langdef>

FileMetadataTask

About this task

Perform this task to specify arbitrary file metadata or file line delimiters. File metadata are stored in Jazz source control management. You can nest <filemetadatarule> and <linedelimiterrule> to apply the rules that specify certain metadata.
Table 9. FileMetadataTask attributes
Attribute Description
projectroot Root directory of a project
Table 10. filemetadatarule attributes
Attribute Description
match A regular expression that is used for this rule.
name The name of the file metadata you want to modify when the regular expression matches the string.
value The value of the file metadata you want to specify. If the value is an empty string, the file metadata is removed.
Table 11. linedelimiterrule attributes
Attribute Description
match A regular expression that is used for this rule.
value The line delimiter that you want to set for the file when the regular expression matches the string. Use one of following line delimiters:
  • None
  • CR
  • LF
  • CRLF
  • Platform

Example

<ld:filemetadata/>

ResolveMetadataTask

About this task

Perform this task to associate the root folder of a project with resource definitions for source and object libraries. It also associates files with language definitions that use default patterns that are defined in language definitions and enclosed LangDefRule data type. These associations are stored in Jazz source control management.
Table 12. ResolveMetadataTask attributes
Attribute Description Default
projectRoot Root directory of the component project  
clean Whether to clear associations or to make associations. When it is set to clear, other task attributes are ignored and all associations are cleared. False
sourcelibrary Resource definition name for source library.  
objectlibrary Resource definition name for object library.  
useDefaultRules Whether default patterns defined in language definitions are also used for pattern matching, in addition to the ones in the rules that are given explicitly. True
Table 13. landefrule attributes
Attribute Description Default
languagedefinition The language definition name. None
match A regular expression that is used for matching a file path name and the specified language definition None

Example

<ld:resolvemetadata sourcelibrary="sourceLibrary" objectlibrary="objectLibrary">
    <ld:langdefrule match="QDDSSRC/MLGREFP\.PF$" languagedefinition="Build_Referenced_Files"/>
    <ld:langdefrule match="QRPGLEINC/.+\.RPGLE$"
languagedefinition="RPG_Include_Files(no_translators)"/>
</ld:resolvemetadata>

SourceCodeDataTask

About this task

Perform this task to enable or disable source code data scanning for the stream, into which the current repository workspace flows. This task also creates dependency source code data based on the enclosed SourceCodeDataRule data type.
Table 14. SourceCodeData attributes
Attribute Description Default
projectroot Root directory of a project. None
scan A Boolean value that indicates whether source code data scanning is enabled or not. true (enabled)
A SourceCodeDataTask can enclose one or more SourceCodeDataRule data types. SourceCodeDataRule data type can contain the following attributes:
Table 15. SourceCodeDataRule attributes
Attribute Description Default
match A regular expression that is used for matching a file path name. None
A SourceCodeRule data type can enclose one or more DependencyData data types. DependencyData data types define the dependency data that is created when the regular expression in the SourceCodeRule matches. When a SourceCodeRule data type does not enclose any DependencyData data types, the SourceCodeDataTask deletes all user-defined dependency data for the matched files. DependencyData data type can contain following attributes:
Table 16. DependencyData attributes
Attribute Description
logicalName Dependency logical name.
fileType Dependency file type.
path Dependency path.
referenceType Dependency reference type.

Example

The following is an example of a SourceCodeDataTask:

<ld:sourcecodedata>
    <ld:sourcecodedatarule match="QLNKSRC/MLGRPTS\.SRVPGMSRC$">
        <ld:dependency logicalName="MLGRPTR" fileType="USE" path="*LIBL/MLGRPTR
OBJTYPE(*MODULE)" referenceType="SRVPGM External File"/>
    </ld:sourcecodedatarule>
</ld:sourcecodedata>

ExportTask

About this task

Perform this task to export data set definitions, translators, and language definitions to a build XML file. You can run the build XML file with Ant and the system definitions generator.
Important: When you run the system definitions generator with the exported build XML, a new set of system definitions is created. These new system definitions have the same attributes as the original system definitions, but they have different universally unique identifiers (UUIDs). You must associate your files and folders with these new system definitions by running the ResolveMetadataTask task in the system definitions editor.
Table 17. ExportTask attributes
Attribute Description Default
file The path to a build XML file that is used as the output  
global Specifies the range of system definitions to export. If the value of global is set to true, all readable system definitions in one or more project areas are exported. If the value of global is set to False, only the system definitions in the current project area are exported. false

Example

The following is an example of an ExportTask:

<target name="export" description="Export existing system definitions to the specified file">
    <ld:export file="c:/tmp/exported.xml"/>
    <ld:export file="C:/tmp/exported_globally.xml" global="true"/>
</target>

DeleteResDefsTask

About this task

Perform this task to delete obsolete or unneeded resource definitions. The default behavior of this task is to delete all resource definitions unless at least one ResDefNameRule is specified as a nested element. The DeleteResDefTask element has no attributes. Nested ResDefNameRule elements can be included to specify which resource definitions to delete. The following is a list of attributes for the ResDefNameRule element:
Table 18. ResDefNameRule attributes
Attribute Description Default
match The regular expression that is used for this rule. The regular expression is compared to the resource name, and if it matches the resource name, the resource definition is deleted. None

Example

The following is an example of the DeleteResDefTask where all resource definitions are deleted:

<target name="example01" description="Delete all resource definitions" >
  <ld:deleteresdefs/>
</target>

The following is an example of the DeleteResDefTask where only the specified resource definition named delete.definition is deleted:

<target name="example02" description="Delete a resource definition" >
  <ld:deleteresdefs>
     <ld:resdefnamerule match="^delete\.definition$"/>
  </ld:deleteresdefs>
</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