How Makex Works¶
Run/Execute¶
For example:
makex run :task
Find the specified makex file(s) based on the task specified.
e.g. “$PWD/Makexfile:task”
Parsing stage:
While there is a queue of makex files to parse:
Repeat the per file parsing steps.
Add any dependent tasks/makex files to the parsing queue.
Per file parsing steps:
Evaluate the file to produce/collect TaskObjects and information:
Validate and transform the AST.
Syntax is Restricted. Imports are disabled.
Primitive values and syntax are transformed to contain or pass location information.
Compile the AST into bytecode and execute.
Store each TaskObject produced by
task()
calls in a graph (Graph 1).
Evaluation stage (using Graph 1):
Start pool with a queue for execution of tasks.
For each specified task to run:
Find the Task in Graph 1 and all of its dependencies.
Evaluate each dependency, and the task into EvaluatedTask objects.
Evaluate each of the arguments, such as finds/globs.
Queue the EvaluatedTask as necessary for execution (if they are dirty/stale).
Add the EvaluatedTask to Graph 2.
Execution Pool: While there is a queue of tasks to run/execute:
Execute each dependency before reaching the specified task.
Run each action of the specified task.