Chapter 5. The Task system

Table of Contents

Task creation and execution
Task execution
Task execution in parallel
Task execution order
Executing tasks only when something changes

Task creation and execution

When Waf tasks are created, they are not executed immediately, for example it is not necessary to rebuild an application if the source files have not changed. Some tasks may also depend on other tasks which may not be created yet. For this reasons Waf delays the execution of tasks to the point when all build functions have been executed.

Creating all tasks by hand is a tedious process that the task generators (Chapter 6, Task encapsulation using task generators) may automate. Before starting the build, Waf asks each task generator to produce the corresponding tasks. If Waf is launched from a sub folder inside the source directory, it will try to avoid the creation of the tasks that are not relevant for that particular sub folder (optimization).

Once the tasks are created, Waf will review each of them one by one to decide whether to execute them or not. A summary can be found on the following diagram: