Global "Build Variant Framework" object. This object is not available in build variant scripts that run in the context of the model compiler.
Methods
(static) add(…buildVariants)
Adds one or several build variants to be available for the current build.
Each build variant object describes a control in the Model RealTime user interface that can be used for enabling a particular build variation.
The argument objects will be validated to ensure they are well-formed BuildVariant objects.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
buildVariants |
BuildVariant |
<repeatable> |
One or several objects describing a build variant. |
Example
BVF.add({
name: 'Debug',
script: 'debug.js',
description: 'Debug build'
});
(static) addCommonUtils(…commonUtils)
Adds one or several sets with common utility functions. Should be called from initBuildVariants function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
commonUtils |
CommonUtils |
<repeatable> |
One or several objects describing common utilities. |
Example
let myUtils = {
name: 'My utils',
script: 'myUtils.js'
}
function initBuildVariants(tc) {
BVF.addCommonUtils(myUtils);
...
}
(static) addPredefConfigs(…buildConfigurations)
Adds one or several predefined build configurations. Each predefined build configuration will appear initially in the Configuration
dropdown menu in the Model RealTime user interface.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
buildConfigurations |
BuildConfiguration |
<repeatable> |
One or several objects describing predefined build configurations. |
Example
BVF.addPredefConfigs({
name:'My config',
config:'Debug;Target=Linux'
});
(static) formatError(msg, …argsopt)
Prints an error message. When executed in the context of the Model RealTime user interface the message will be printed in the Build Variants console.
When executed in the context of the model compiler the message will be printed as a regular model compiler message with error severity.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
msg |
string | Message to be printed | |
args |
object |
<optional> <repeatable> |
Arguments that matches placeholders in the msg string. The type of the argument should match the type of placeholder, for example %s for string etc. |
(static) formatInfo(msg, …argsopt)
Prints an informational message. When executed in the context of the Model RealTime user interface the message will be printed in the Build Variants console.
When executed in the context of the model compiler the message will be printed as a regular model compiler message with information severity.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
msg |
string | Message to be printed | |
args |
object |
<optional> <repeatable> |
Arguments that matches placeholders in the msg string. The type of the argument should match the type of placeholder, for example %s for string etc. |
(static) formatWarning(msg, …argsopt)
Prints a warning message. When executed in the context of the Model RealTime user interface the message will be printed in the Build Variants console.
When executed in the context of the model compiler the message will be printed as a regular model compiler message with warning severity.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
msg |
string | Message to be printed | |
args |
object |
<optional> <repeatable> |
Arguments that matches placeholders in the msg string. The type of the argument should match the type of placeholder, for example %s for string etc. |
(static) setDefaultConfig(buildConfiguration)
Sets a default build configuration. It will be initially selected in the Configuration dropdown menu in the Model RealTime user interface.
It is enough to specify the "name" property of the BuildConfiguration since that is what is used for identifying it.
Parameters:
Name | Type | Description |
---|---|---|
buildConfiguration |
BuildConfiguration | An object describing the default build configuration. |
Example
BVF.setDefaultConfig({name:'My config'});