Base class for all abstract targets.
class abstract-target { rule __init__ ( name : project ) rule name ( ) rule project ( ) rule location ( ) rule full-name ( ) rule generate ( property-set ) }
Classes derived from abstract-target:
rule __init__ ( name : project )
name
The name of the target in the Jamfile.
project
The project to which this target belongs.
rule name ( )
Returns the name of this target.
rule project ( )
Returns the project for this target.
rule location ( )
Returns the location where the target was declared.
rule full-name ( )
Returns a user-readable name for this target.
rule generate ( property-set )
Generates virtual targets for this abstract target using the specified properties, unless a different value of some feature is required by the target. This is an abstract method which must be overriden by derived classes.
On success, returns:
If property-set
is empty, performs the
default build of this target, in a way specific to the derived class.
class project-target : abstract-target { rule generate ( property-set ) rule build-dir ( ) rule main-target ( name ) rule has-main-target ( name ) rule find ( id : no-error ? ) # Methods inherited from abstract-target rule name ( ) rule project ( ) rule location ( ) rule full-name ( ) }
This class has the following responsibilities:
Maintaining a list of main targets in this project and building them.
rule generate ( property-set )
Overrides abstract-target.generate. Generates virtual targets for all the targets contained in this project.
On success, returns:
rule build-dir ( )
Returns the root build directory of the project.
rule main-target ( name )
Returns a main-target
class instance corresponding to name
.
Can only be called after the project has been fully loaded.
rule has-main-target ( name )
Returns whether a main-target with the specified name exists. Can only be called after the project has been fully loaded.
rule find ( id : no-error ? )
Find and return the target with the specified id, treated relative to
self. Id may specify either a target or a file name with the target taking
priority. May report an error or return nothing if the target is not found
depending on the no-error
parameter.
class main-target : abstract-target { rule generate ( property-set ) # Methods inherited from abstract-target rule name ( ) rule project ( ) rule location ( ) rule full-name ( ) }
A main-target represents a named top-level target in a Jamfile.
rule generate ( property-set )
Overrides
abstract-target.generate.
Select an alternative for this main target, by finding all alternatives
whose requirements are satisfied by property-set
and
picking the one with the longest requirements set. Returns the result
of calling generate
on that alternative.
On success, returns:
class basic-target : abstract-target { rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * ) rule generate ( property-set ) rule construct ( name : source-targets * : property-set ) # Methods inherited from abstract-target rule name ( ) rule project ( ) rule location ( ) rule full-name ( ) }
Implements the most standard way of constructing main target alternative from sources. Allows sources to be either files or other main targets and handles generation of those dependency targets.
rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * )
name
The name of the target
project
The project in which the target is declared.
rule generate ( property-set )
Overrides abstract-target.generate. Determines final build properties, generates sources, and calls construct. This method should not be overridden.
On success, returns:
rule construct ( name : source-targets * : property-set )
Constructs virtual targets for this abstract target. Returns a usage-requirements property-set and a list of virtual targets. Should be overriden in derived classes.
class typed-target : basic-target { rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * ) rule type ( ) rule construct ( name : source-targets * : property-set ) # Methods inherited from abstract-target rule name ( ) rule project ( ) rule location ( ) rule full-name ( ) # Methods inherited from basic-target rule generate ( property-set ) }
typed-target is the most common kind of target alternative. Rules for creating typed targets are defined automatically for each type.
rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * )
rule type ( )
Returns the type of the target.
rule construct ( name : source-targets * : property-set )
Implements basic-target.construct. Attempts to create a target of the correct type using generators appropriate for the given property-set. Returns a property-set containing the usage requirements and a list of virtual targets.
This function is invoked automatically by basic-target.generate and should not be called directly by users.
Class for storing a set of properties.
class property-set { rule raw ( ) rule str ( ) rule propagated ( ) rule add ( ps ) rule add-raw ( properties * ) rule refine ( ps ) rule get ( feature ) }
There is 1<->1 correspondence between identity and value. No two instances of the class are equal. To maintain this property, the 'property-set.create' rule should be used to create new instances. Instances are immutable.
rule raw ( )
Returns a Jam list of the stored properties.
rule str ( )
Returns the string repesentation of the stored properties.
rule propagated ( )
Returns a property-set containing all the propagated properties in this property-set.
rule add ( ps )
Returns a new
property-set containing the union of the properties
in this
property-set and in ps
.
If ps
contains non-free properties
that should override the values in this object, use
refine instead.
rule add-raw ( properties * )
Link add, except that it takes a list of properties instead of a property-set.
rule refine ( ps )
Refines properties by overriding any non-free and non-conditional
properties for which a different value is specified in
ps
. Returns the resulting
property-set.
rule get ( feature )
Returns all the values of feature
.