Package SCons :: Package Script :: Module Main :: Class BuildTask
[hide private]
[frames] | no frames]

Class BuildTask

source code

          object --+        
                   |        
     Taskmaster.Task --+    
                       |    
Taskmaster.OutOfDateTask --+
                           |
                          BuildTask

An SCons build task.
Instance Methods [hide private]
 
display(self, message)
Hook to allow the calling interface to display a message.
source code
 
prepare(self)
Called just before the task is executed.
source code
 
needs_execute(self)
Returns True (indicating this Task should be executed) if this Task's target state indicates it needs executing, which has already been determined by an earlier up-to-date check.
source code
 
execute(self)
Called to execute the task.
source code
 
do_failed(self, status=2) source code
 
executed(self)
Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods.
source code
 
failed(self)
Default action when a task fails: stop the build.
source code
 
postprocess(self)
Post-processes a task after it's been executed.
source code
 
make_ready(self)
Make a task ready for execution
source code

Inherited from Taskmaster.Task: __init__, exc_clear, exc_info, exception_set, executed_with_callbacks, executed_without_callbacks, fail_continue, fail_stop, get_target, make_ready_all, make_ready_current, trace_message

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  progress = Null(0x0A0EF4EC)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

display(self, message)

source code 

Hook to allow the calling interface to display a message.

This hook gets called as part of preparing a task for execution (that is, a Node to be built). As part of figuring out what Node should be built next, the actually target list may be altered, along with a message describing the alteration. The calling interface can subclass Task and provide a concrete implementation of this method to see those messages.

Overrides: Taskmaster.Task.display
(inherited documentation)

prepare(self)

source code 

Called just before the task is executed.

This is mainly intended to give the target Nodes a chance to unlink underlying files and make all necessary directories before the Action is actually called to build the targets.

Overrides: Taskmaster.Task.prepare
(inherited documentation)

needs_execute(self)

source code 
Returns True (indicating this Task should be executed) if this Task's target state indicates it needs executing, which has already been determined by an earlier up-to-date check.
Overrides: Taskmaster.Task.needs_execute

execute(self)

source code 

Called to execute the task.

This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed().

Overrides: Taskmaster.Task.execute
(inherited documentation)

executed(self)

source code 

Called when the task has been successfully executed and the Taskmaster instance wants to call the Node's callback methods.

This may have been a do-nothing operation (to preserve build order), so we must check the node's state before deciding whether it was "built", in which case we call the appropriate Node method. In any event, we always call "visited()", which will handle any post-visit actions that must take place regardless of whether or not the target was an actual built target or a source Node.

Overrides: Taskmaster.Task.executed_with_callbacks
(inherited documentation)

failed(self)

source code 

Default action when a task fails: stop the build.

Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().

Overrides: Taskmaster.Task.failed
(inherited documentation)

postprocess(self)

source code 

Post-processes a task after it's been executed.

This examines all the targets just built (or not, we don't care if the build was successful, or even if there was no build because everything was up-to-date) to see if they have any waiting parent Nodes, or Nodes waiting on a common side effect, that can be put back on the candidates list.

Overrides: Taskmaster.Task.postprocess
(inherited documentation)

make_ready(self)

source code 
Make a task ready for execution
Overrides: Taskmaster.Task.make_ready_current