The direct instances of TaskBase are quite limited and do not track the changes to the source files. The class Task provides the necessary features for the most common builds in which source files are used to produce target files. The idea is to create a unique signature for tasks, and to represent the dependencies on files or other tasks by including them in the signature. A hashing function is used for computing the signature, by default it is md5.
The following diagram illustrates the task processing including the signature, it is only valid for Task instance (not TaskBase instances):
The signature computation uses the following data:
Here is an example illustrating the different kinds of dependencies:
import Task class task_demo(Task.Task): vars = ['CXXFLAGS', 'LINKFLAGS']def scan(self):
return [[self.inputs[0].parent.find_resource('.svn/entries')], []] task = task_demo() task.inputs = [bld.path.find_resource('test.cxx')]
task.deps_man = [bld.path.find_resource('wscript')]
bld.add_manual_dependency('main.c', 'an arbitrary string value')
bld.add_manual_dependency( bld.path.find_or_declare('test_c_program'), bld.path.find_resource('bbb'))
![]()
Environment variable dependencies (compilation flags) | |
Implicit dependencies: a method returns a list containing the list of additional nodes to take into account, and the list of the files that could not be found (cache) | |
Explicit dependencies as input files (nodes) | |
Explicit dependencies as manual dependencies | |
Manual dependencies on source files, the second parameter can be a string, a node object or a function returning a string | |
Manual dependencies with nodes, the first node represents a target (which may or may not exist in the build), and the second parameter represents a file in the source directory. |