Global

Members

CppTransformType :string

Transformation configuration types for C++
Type:
  • string
Properties:
Name Type Description
Library string C++ Library
ExternalLibrary string C++ External Library
Executable string C++ Executable
TestExecutable string C++ Test Executable

Methods

initBuildVariants(tc)

This is the entry point of a Build Variants script. It must be present and gets called by the {{DOC_PRODUCT}} user interface when a TC is about to be built (or transformed). The implementation of the function should construct JavaScript objects that describe the controls that will be present in the user interface for selecting which variant of the application to build.
Parameters:
Name Type Description
tc TCObject Transformation configuration that is about to be built (or transformed)

load(path)

This function can be used to evaluate additional JavaScript files with customer-specific global utility functions in the context of build variant implementation JS file. You can put a number of global helpful functions into some JS file and load it in one of the first lines of your build variants implementation files wherever you need them. You can also access environment variables with standard Java system functions to get some common paths.
Parameters:
Name Type Description
path string Full path to the JavaScript file that will be evaluated in the current context.
Example
let env = java.lang.System.getenv();
load(env.MY_BUILD_VARIANTS_LOCATION + '/myUtils.js');
load('/opt/common/bvutils/debugprint.js');
load(TCF.buildVariantsFolder() + '/myUtils.js');

postProcess(topTC, allTCs, …args)

This function can be defined in a build variant script in order to perform some actions just after the default processing of the built TC. You can manipulate all settings in the built TC, and its prerequisites, in order to accomplish the desired build.
Parameters:
Name Type Attributes Description
topTC TCObject TC that will be built. This is the "top" TC, i.e. the TC selected to be built (as opposed to a prerequisite TC).
allTCs Array.<TCObject> An array consisting of all TCs that will be built. This is the list of all prerequisite TCs followed by the "top" TC itself.
args any <repeatable>
Custom arguments passed to the function by means of the "args" property in the BuildVariant object.

preProcess(projectName, …args)

This function can be defined in a build variant script in order to perform some actions just before the default processing of the built TC. Note that since the TC has not yet been processed, it is not possible to read its settings. What you typically can do in this function is to set-up values for global variables that are referenced inside the built TC or its prerequisites. Thereby you can affect the evaluation of such TC settings which in turn will have an effect on the build.
Parameters:
Name Type Attributes Description
projectName string Name of Eclipse project to which the built TC belongs.
args any <repeatable>
Custom arguments passed to the function by means of the BuildVariant.args property in the BuildVariant object.

Type Definitions

Alternative

An object representing an alternative for an enumeration build variant. It corresponds to an item in a dropdown menu in the user interface.
Type:
  • object
Properties:
Name Type Attributes Description
name string Name of this alternative. Corresponds to the menu item label in the dropdown menu.
script string Build variant script file to be invoked by the model compiler when this alternative has been chosen for the enumeration build variant. This script file must have one or both of the global functions preProcess or postProcess defined. If a relative path is used to specify the script file it will be interpreted relative to the folder with build variants declaration script.
args Array.<object> <optional>
Optional array of arguments to pass to the script file when this alternative has been chosen for the enumeration build variant.
description string <optional>
Optional description of the alternative. This text will appear as a tooltip of the dropdown control in the user interface when this particular alternative has been chosen.
defaultValue boolean <optional>
Specifies if this alternative should be chosen by default for the enumeration build variant.

BuildConfiguration

A build configuration is a set of build variants that are enabled for a build. It has a textual representation which is a semicolon- separated list of build variants, where each boolean build variant is identified by its name, and each enumeration build variant is identified by its name followed by an equal sign and then followed by the name of one of its alternatives. For example: "Debug; Target=Linux".
Type:
  • object
Properties:
Name Type Attributes Description
name string The name of the build configuration. It corresponds to an item in the Configuration dropdown menu in the {{DOC_PRODUCT}} user interface.
config string The textual representation of the build configuration as explained above.
description string <optional>
A description of the build configuration. It will appear as a tooltip when the build configuration has been selected in the {{DOC_PRODUCT}} user interface.

BuildVariant

An object representing a variation in how an application can be built (a so called "build variant"). This object specifies which control to use in the {{DOC_PRODUCT}} user interface for enabling that particular build variant. It also specifies which script the model compiler should invoke when the build variant is enabled (either in the user interface or by means of command-line options for the model compiler).
Type:
  • object
Properties:
Name Type Attributes Description
name string The name of the build variant
script string Build variant script file to be invoked by the model compiler when this particular build variant is enabled. This script file must have one or both of the global functions preProcess or postProcess defined. If a relative path is used to specify the script file it will be interpreted relative to the folder with build variants declaration script. This property is applicable for boolean build variants.
args Array.<object> <optional>
Optional array of arguments to pass to the script file. This property is applicable for boolean build variants.
control UIControl <optional>
Optional specification of the control to use for this build variant in the {{DOC_PRODUCT}} user interface. If omitted the structure of the BuildVariant object determines which control to use.
defaultValue string | boolean <optional>
Optional default value for the build variant. For a boolean (checkbox) this should be either true or false, while for an enumeration (dropdown) it should be the name of one of the alternatives (enumeration literals). Note that for enumerations you can also specify the default value using the "defaultValue" property of an Alternative.
description string <optional>
Optional description of what the build variant does. This text will appear as a tooltip of the build variant control in the user interface.
alternatives Alternative <optional>
Describes the alternatives for an enumeration (dropdown) build variant. Each alternative corresponds to an item in a dropdown menu in the user interface.

CommonUtils

An object representing a set of common utility functions and corresponding script file with implementations. This set of utilities can be added in initBuildVariants function and later they will be automatically evaluated and available in all build variants implementation files.
Type:
  • object
Properties:
Name Type Attributes Description
name string The name of common utils set
script string A script file with common utility functions implementations. If a relative path is used to specify the script file it will be interpreted relative to the folder with build variants declaration script.
description string <optional>
Optional description of the utilities included into the set.

TCObject

An object representing a transformation configuration.
Type:
  • object
Properties:
Name Type Description
isAbstract string True if the TC is abstract, false otherwise
bodyExtension string
buildLibraryArguments string
buildLibraryCommand string
capsulesToTest string
codeSyncEnabled string
commonPreface string
commonPrefaceIfdef string
compilationMakeArguments string
compilationMakeCommand string
compilationMakeInsert string
compilationMakeType string
compilationTopMakeArguments string
compilationTopMakeCommand string
compileArguments string
compileCommand string
compileIndividually string
constantDefinitions string
constantProvider string
contextSensitiveLibraryBuild string
copyrightText string
defaultArguments string
docCommentStyle string
environment string
eval TCObject Holds an object with evaluated properties taking into account inherited and default values. With tc.eval.propertyName you can access the actual property value used for build, while tc.propertyName would give the value specified for current tc or 'null' if the field is not set (without applying defaults or computing inheritance).
executableName string
externalCommand string
externalCleanCommand string
externalConfigurationName string
externalContainer string
fastLaneForFrequent string
genUserCodeQualifiers string
generateClassInclusions string
generateMakefileForExternalProject string
headerExtension string
includeFilename string
inclusionPaths string
jetTransformationId string
language string
languagePreference string
libraries string
libraryName string
linkArguments string
linkCommand string
linkOrder string
createTargetProject string
parents Array.<string> Inherited TCs. Each parent TC is specified by means of its Eclipse platform URL that is on the form 'platform:/resource/PROJECT/TC_FILENAME'.
prefix string
prerequisites Array.<string> Prerequisites for the TC. Each prerequisite TC is specified by means of its Eclipse platform URL that is on the form 'platform:/resource/PROJECT/TC_FILENAME'.
progesssData string
shortUnitInclude string
sources Array.<string> List of source elements for the TC. Each source element is specified by means of its URI.
sourceLanguagePrefix string
sourceRestriction string
sourceSubdirectory string
supportForFileArtifacts string
targetConfiguration string
targetConfigurationName string
targetLocation string
targetRestriction string
targetServicesLibrary string
testContainerName string
testsRunnerName string
threads string
topCapsule string
translators string
type CppTransformType The type of TC.
unitName string
unitSubdirectory string
useAbsolutePaths string
useGenericToolChain string
userLibraries string
userObjectFiles string
targetProject string

UIControl

An object representing a control for enabling a certain build variant in the {{DOC_PRODUCT}} user interface.
Type:
  • object
Properties:
Name Type Description
kind string Specifies the kind of control. Currently two kinds of controls are supported: "checkbox" and "dropdown".