Package SCons :: Module Builder
[hide private]
[frames] | no frames]

Module Builder

source code

SCons.Builder

Builder object subsystem.

A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking.

The main entry point here is the Builder() factory method. This provides a procedural interface that creates the right underlying Builder object based on the keyword arguments supplied and the types of the arguments.

The goal is for this external interface to be simple enough that the vast majority of users can create new Builders as necessary to support building new types of files in their configurations, without having to dive any deeper into this subsystem.

The base class here is BuilderBase. This is a concrete base class which does, in fact, represent the Builder objects that we (or users) create.

There is also a proxy that looks like a Builder:

CompositeBuilder

This proxies for a Builder with an action that is actually a dictionary that knows how to map file suffixes to a specific action. This is so that we can invoke different actions (compilers, compile options) for different flavors of source files.

Builders and their proxies have the following public interface methods used by other modules:

There are the following methods for internal use within this module:

Classes [hide private]
  _Null
  _null
  DictCmdGenerator
This is a callable class that can be used as a command generator function. It holds on to a dictionary mapping file suffixes to Actions. It uses that dictionary to return the proper action based on the file suffix of the source file.
  CallableSelector
A callable dictionary that will, in turn, call the value it finds if it can.
  DictEmitter
A callable dictionary that maps file suffixes to emitters. When called, it finds the right emitter in its dictionary for the suffix of the first source file, and calls that emitter to get the right lists of targets and sources to return. If there's no emitter for the suffix in its dictionary, the original target and source are returned.
  ListEmitter
A callable list of emitters that calls each in sequence, returning the result.
  OverrideWarner
A class for warning about keyword arguments that we use as overrides in a Builder call.
  EmitterProxy
This is a callable class that can act as a Builder emitter. It holds on to a string that is a key into an Environment dictionary, and will look there at actual build time to see if it holds a callable. If so, we will call that as the actual emitter.
  BuilderBase
Base class for Builders, objects that create output nodes (files) from input nodes (files).
  CompositeBuilder
A Builder Proxy whose main purpose is to always have a DictCmdGenerator as its action, and to provide access to the DictCmdGenerator's add_action() method.
Functions [hide private]
 
match_splitext(path, suffixes=[]) source code
 
Builder(**kw)
A factory for builder objects.
source code
 
_node_errors(builder, env, tlist, slist)
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
source code
 
is_a_Builder(obj)
"Returns True if the specified obj is one of our Builder classes.
source code
Variables [hide private]
  __revision__ = 'src/engine/SCons/Builder.py 3a41ed6b288cee8d08...
  misleading_keywords = {'sources': 'source', 'targets': 'target'}
  __package__ = 'SCons'
Function Details [hide private]

is_a_Builder(obj)

source code 

"Returns True if the specified obj is one of our Builder classes.

The test is complicated a bit by the fact that CompositeBuilder is a proxy, not a subclass of BuilderBase.


Variables Details [hide private]

__revision__

Value:
'src/engine/SCons/Builder.py 3a41ed6b288cee8d085373ad7fa02894e1903864 \
2019-01-23 17:30:35 bdeegan'