Namespace: TCF

TCF

Global "Transformation Configuration Framework" object. This object is only available in build variant scripts that run in the context of the model compiler.

Methods

(static) buildVariantsFolder() → {string}

This function returns a path to the folder that contains JavaScript file with build variants declarations. Build variants implementation JavaScript files and files with commonly used utils are usually also stored in that folder.
Returns:
An absolute path to the folder that contains build variants declaration file
Type
string
Example
// Load JavaScript file with specific user-defined utility functions
load(TCF.buildVariantsFolder() + '/myUtils.js');

(static) buildVariantsScript() → {string}

This function returns build variants declaration file specified in global preferences. It can be used for information printout.
Returns:
Build variants declaration JavaScript file
Type
string

(static) define(descriptorId) → {TCObject}

The main method to create new transformation configuration. The first created transformation configuration in a file is considered as root TC for this file. This method returns an object implementing Map interface. Each created transformation has string ID. The first (root) transformation defined in a file get ID that matches URI of file (frameworks attempts to compute platform:/resource URI for file).
Parameters:
Name Type Description
descriptorId string Predefined kind of Transformation Configuration that will be created
Returns:
An object representing newly created Transformation Configuration
Type
TCObject
Example
let tc = TCF.define(TCF.CPP_TRANSFORM);
tc.x = value;
var transformId = tc.getId();

(static) getTopTC() → {TCObject}

Returns top TC for current transformation. It can be used from prerequisite TCs to check some properties from top transformation configuration.
Returns:
Top Transformation Configuration for current transformation
Type
TCObject
Example
let tc = TCF.define(TCF.CPP_TRANSFORM);
let topTC = TCF.getTopTC().eval;
tc.targetServicesLibrary = topTC.targetServicesLibrary;

(static) globals() → {object}

Returns an object with global settings. This object can be retrieved at any time during the build process. It can for example be used as a means to store information across different calls of build variant scripts.
Returns:
Object with global settings.
Type
object
Example
if (TCF.globals().myStringProperty == 'hello') {
  TCF.globals().myIntProperty = 1;
};

(static) orderedGraph(topTC) → {Array.<TCObject>}

Returns array of all prerequisites of given TC in depth-first order. The last element is the top TC itself. This method performs loading of all prerequisite and parents TCs.
Parameters:
Name Type Description
topTC TCObject Top Transformation Configuration
Returns:
An ordered list of all prerequisites for given TC, starting from inner-most, ending with top TC.
Type
Array.<TCObject>
Example
var prereqs = TCF.orderedGraph(tc);
for (i = 0; i < prereqs.length; ++i) {
   var arguments = prereqs[i].compileArguments;
}

(static) resolveURI(ref) → {string}

Resolves platform resource URI and returns an absolute file path
Parameters:
Name Type Description
ref string platform:/resource URI
Returns:
An absolute path to resource, or null if resolution failed.
Type
string