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

Module Builder

source code


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:


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]
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.
A callable dictionary that will, in turn, call the value it finds if it can.
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.
A callable list of emitters that calls each in sequence, returning the result.
A class for warning about keyword arguments that we use as overrides in a Builder call.
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.
Base class for Builders, objects that create output nodes (files) from input nodes (files).
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
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
"Returns True if the specified obj is one of our Builder classes.
source code
Variables [hide private]
  __revision__ = 'src/engine/SCons/ 74b2c53bc42290e911...
  misleading_keywords = {'sources': 'source', 'targets': 'target'}
  __package__ = 'SCons'
Function Details [hide private]


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]


'src/engine/SCons/ 74b2c53bc42290e911b334a6b44f187da698a668 \
2017/11/14 13:16:53 bdbaddog'