Create a language definition to specify the translator performed
on each member during a build, and to specify the scanners used to
collect source code data about dependencies.
Before you begin
Before you begin this task, you must create a project area. Restriction: Before you can create, modify, or delete a language
definition, you must have permission to make these modifications.
You can manage these permissions from the Project Configuration node
on the Process Configuration tab in the Project Area editor.
About this task
You can create a language definition one of two ways:
- Expand these nodes in the Team Artifacts navigator in your project
area: .
- From the main menu, select .
The following task describes how to create a language definition
from the Language Definitions node in the Team Artifacts navigator.
Procedure
- If you have not already done so, from the Team Artifacts
view, select your repository connection and log in to your IBM® i project
area.
- Expand your team node, then .
- Right-click the Language Definitions node and select New
Language Definition.
The Language Definition editor
opens with three tabs: General, Scanners,
and History.
- In the Name field, give your new
language definition a name.
- On the General tab, in the Language field,
select the language (code) that your language definition should use.
- In the File Extensions field, indicate
all the file extensions you want to associate with this language definition;
for example, cbl for COBOL files.
If
you provide extensions here, and if the extensions do not already
have explicit language definitions associated with them, any files
that have those extensions are associated with this language
definition.
- Optional: In the Description field,
briefly describe your language definition.
- Optional: If you made changes to this language
definition that do not require a full analysis of buildable files,
click the Ignore changes to this system definition for
dependency builds check box.
- Optional: Select Do not calculate
impacted files to prevent the calculation of impacted
files when performing dependency analysis.
- In the Translators field, specify
and arrange the build order of the translators you want to define
for this language definition.
Note: You can also select
one or more translators, or specify a particular build property to
associate with your new language definition that will call on a particular
translator when you run a build. These options are available when
you click Add in the Translators section of
the Language Definition wizard.
If you want to run any translator
conditionally, specify the condition for the translator that must
be met before the translator can run. Conditions should be specified
as Ant conditions, such as
<ac:islessthan arg1="1" arg="2">.
Each time the language definition runs, the condition is evaluated
to determine whether the translator should be run. The following notes
apply when conditional translators are used:
Notes:
- To use conditions for translators, you must install the version 6.0.5 Build System Toolkit that provides the Ant build toolkit. If you use the Build System Toolkit from a previous version, errors occur.
- Trust outputs must be true.
- Preview builds might not accurately represent what would really
happen in a build, because the preview build cannot always predict
the correct system definitions to use. If you have multiple translators
or properties defined, the first artifact defined is used. However,
if a non-conditional artifact is defined, that one is used, and all
conditional artifacts with the same name are skipped.
- In the Properties field, you can
specify properties, values, and optional conditions for the language
definition. The specified properties are similar to build properties,
but only apply to the language definitions; they do not apply to the
rest of the build. Conditions should be specified as Ant conditions,
such as
<ac:islessthan arg1="1" arg="2">.
Note: If a property and a build property have the same name,
the language definition property overrides the build property while
the language definition is running. After the language definition
completes, the build property is set to the original value.
- On the Scanners tab, in the Source Code Scanners section,
specify which scanners you want to run against source code that is
associated with this language definition.
If you do not
want to use the default scanner, you can add or remove scanners. Use
Up and
Down to
rearrange the scanners.
For more information about specifying scanners,
see Specifying a source code data scanner.
- In the Dependency Types field, specify
the dependency types supported by this language definition. Make sure
you also specify the translators that resolve each dependency type.
You can add, edit, or remove dependency types and translators
using the appropriate buttons.
- On the History tab, you can see
all changes made over time by different users to the language definition.
You can review the state of the language definition at any point in
time, which is useful for debugging and fixing dependency build problems.
- Click Save to save your new language
definition.
What to do next
You can also duplicate any language definition. To do this,
perform the following steps:
- Open the Team Artifacts view.
- Expand your team node, then .
- Right-click the language definition you want to duplicate.
- Select Duplicate. The Duplicate language
definition window opens.
- In the Name field, give your duplicate
language definition a name.
- Click OK to duplicate the language definition
or Cancel to stop.
- Your new duplicate language definition should be displayed under
the Language Definitions node. If it does not, refresh the view.