From b2939bc1fae00f5d6c0e83992fc9ebbe1bcb5370 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 7 Apr 2012 19:18:27 +0000 Subject: [PATCH] Document typed-target. [SVN r77821] --- doc/src/extending.xml | 7 +-- doc/src/reference.xml | 1 + doc/src/typed-target.xml | 106 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 doc/src/typed-target.xml diff --git a/doc/src/extending.xml b/doc/src/extending.xml index 992f47b69..7e3641509 100644 --- a/doc/src/extending.xml +++ b/doc/src/extending.xml @@ -143,7 +143,7 @@ basic-target and create new metatarget rule that creates instance of such target. However, in the majority of cases, a specific subclass of basic-target— - typed-target is used. That class is associated + typed-target is used. That class is associated with a type and relays to generators to construct concrete targets of that type. This process will be explained below. When a new type is declared, a new metatarget rule is automatically defined. @@ -207,11 +207,12 @@ return [ sequence.transform virtual-target.register : $(targets) ] ; fact, Boost.Build defines concept of target type and generators generators, and has special metatarget class - typed-target. Target type is merely an + typed-target. Target type is merely an identifier. It is associated with a set of file extensions that correspond to that type. Generator is an abstraction of a tool. It advertises the types it produces and, if called with a set of input target, tries to construct - output targets of the advertised types. Finally, typed-target + output targets of the advertised types. Finally, + typed-target is associated with specific target type, and relays the generator (or generators) for that type. diff --git a/doc/src/reference.xml b/doc/src/reference.xml index c07b28377..deee17c98 100644 --- a/doc/src/reference.xml +++ b/doc/src/reference.xml @@ -1959,6 +1959,7 @@ import path : native make : native-path make-path ; + diff --git a/doc/src/typed-target.xml b/doc/src/typed-target.xml new file mode 100644 index 000000000..2a7d7c98c --- /dev/null +++ b/doc/src/typed-target.xml @@ -0,0 +1,106 @@ + + + +
+ + Class typed-target + + typed-target + + + +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 * ) + + + + name + The name of the target + + + project + + + The project + in which the target is declared. + + + + + type + + + The type + of the target. + + + + + + + + + + type + Typed Target Method + + rule type ( ) + + Returns the type + of the target. + + + + + + construct + Typed Target Method + + 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. + + + + + + + +