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 |
_distDirname |
string | Absolute path of the directory for exporting files.
Calculated from |
_metaDirname |
string | Absolute path of the directory for storing meta files.
Calculated from |
... |
Other properties inherit from |
|
_exportClasses |
object | map-like structure for storing all available constructors describing |
exportClasses |
object | the same as |
exportArray |
Array.<object> | Storage for |
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:
- Read and parse platform modules (files).
- Modules integration. Creation meta files if required.
- Loading integrated structures into
Platform
. - Setting cross-references in platform's elements.
- Checking circular references in mathematical expressions.
- Checking circular unitDef references. Checking circular functionDef rferences.
- Checking left and right side units compatibility for mathematical expressions.
- Checking unit's terms.
- Export of a platform to series of formats.
Depending on the declaration file it runs
Builder#exportMany
orBuilder#exportJuliaOnly
.