Class: Builder

Builder(declaration)

new Builder(declaration)

Auxiliary class for performing compilation and storing a platform's options. The main purpose is a support of Heta compiler's CLI mode.

The main method of the class is Builder#run which
runs a sequence of compilation steps.

Parameters:
Name Type Description
declaration Object

Object representing options for builder, see CLI references for more information about the structure.

Properties:
Name Type Description
container Container

This is the reference to the main platform storage.

logger Logger

Reference to logger object of platform. This object can also be called with this.container.logger

_distDirname string

Absolute path of the directory for exporting files. Calculated from declaration.options.distDir property.

_metaDirname string

Absolute path of the directory for storing meta files. Calculated from declaration.options.metaDir.

...

Other properties inherit from declaration object, see CLI references

_exportClasses object

map-like structure for storing all available constructors describing _Exports.

exportClasses object

the same as _exportClasses but bound to this builder.

exportArray Array.<object>

Storage for _Export instances.

Methods

exportMany()

Run exporting of files based on components of this.container.exportArray.

run()

The method runs building of a platform declared with Builder object. If the execution throws an error platform building will stop.

The sequence of operations is following:

  1. Read and parse platform modules (files).
  2. Modules integration. Creation meta files if required.
  3. Loading integrated structures into Platform.
  4. Setting cross-references in platform's elements.
  5. Checking circular references in mathematical expressions.
  6. Checking circular unitDef references. Checking circular functionDef rferences.
  7. Checking left and right side units compatibility for mathematical expressions.
  8. Checking unit's terms.
  9. Export of a platform to series of formats. Depending on the declaration file it runs Builder#exportMany or Builder#exportJuliaOnly.