Scons is a python based build system.
It tends to be associated with C and C++ builds, but can be used to build other languages.
Testability can be an issue if the build specific code is embedded too tightly with the sConstruct and sConscript files.
Builders
Python function or Module that encapsulates a specific build process.
sCons Tools exist in the 'site_scons/site_tools' directory and can be either:
Python Module(toolname.py) or Package(toolname/__init__.py) that implements the following functions:
generate(env): Adds Builder to scons Environment; not sure where it's called from
exists(): scons uses this to test if Builder exists
Python function that takes an Environment object
Must be included in 'site_scons/site_init.py'
Creating a Builder
Builder(
action|generator: function or command that will be run when builder is invoked; scons variables can be used from here e.g. $SOURCE, $TARGET
[suffix]: String appended to $TARGET; can also be a command that returns a string.
[src_suffix]: String appended to $SOURCE
)
Add the builder to the BUILDER variable:
myBuilder=Builder(action=doSomeStuff)
# This normally goes in a "generate(env)" function
env["BUILDERS"]["<BUILDER_NAME>"]=myBuilder
The Command provides a way of creating simple command based Builders.