mirror of
https://github.com/boostorg/build.git
synced 2026-02-20 02:32:13 +00:00
Document typed-target.
[SVN r77821]
This commit is contained in:
@@ -143,7 +143,7 @@
|
||||
<link linkend="bbv2.reference.class.basic-target">basic-target</link> and create new metatarget rule
|
||||
that creates instance of such target. However, in the majority
|
||||
of cases, a specific subclass of <link linkend="bbv2.reference.class.basic-target">basic-target</link>—
|
||||
<classname>typed-target</classname> is used. That class is associated
|
||||
<link linkend="bbv2.reference.class.typed-target">typed-target</link> is used. That class is associated
|
||||
with a <firstterm>type</firstterm> and relays to <firstterm>generators</firstterm>
|
||||
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
|
||||
<indexterm><primary>generators</primary></indexterm>
|
||||
<firstterm>generators</firstterm>, and has special metatarget class
|
||||
<classname>typed-target</classname>. Target type is merely an
|
||||
<link linkend="bbv2.reference.class.typed-target">typed-target</link>. 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, <classname>typed-target</classname>
|
||||
output targets of the advertised types. Finally,
|
||||
<link linkend="bbv2.reference.class.typed-target">typed-target</link>
|
||||
is associated with specific target type, and relays the generator (or generators)
|
||||
for that type.
|
||||
</para>
|
||||
|
||||
@@ -1959,6 +1959,7 @@ import path : native make : native-path make-path ;
|
||||
<xi:include href="project-target.xml"/>
|
||||
<xi:include href="main-target.xml"/>
|
||||
<xi:include href="basic-target.xml"/>
|
||||
<xi:include href="typed-target.xml"/>
|
||||
<xi:include href="property-set.xml"/>
|
||||
</section>
|
||||
|
||||
|
||||
106
doc/src/typed-target.xml
Normal file
106
doc/src/typed-target.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE section PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
|
||||
|
||||
<section id="bbv2.reference.class.typed-target">
|
||||
|
||||
<title>Class typed-target</title>
|
||||
<indexterm>
|
||||
<primary>typed-target</primary>
|
||||
</indexterm>
|
||||
|
||||
<programlisting language="jam">
|
||||
class typed-target : <link linkend="bbv2.reference.class.basic-target">basic-target</link> {
|
||||
rule <link linkend="bbv2.reference.class.typed-target.__init__">__init__</link> ( name : project : type : sources * : requirements * : default-build * : usage-requirements * )
|
||||
rule <link linkend="bbv2.reference.class.typed-target.type">type</link> ( )
|
||||
rule <link linkend="bbv2.reference.class.typed-target.construct">construct</link> ( name : source-targets * : property-set )
|
||||
|
||||
# Methods inherited from <link linkend="bbv2.reference.class.abstract-target">abstract-target</link>
|
||||
rule <link linkend="bbv2.reference.class.abstract-target.name">name</link> ( )
|
||||
rule <link linkend="bbv2.reference.class.abstract-target.project">project</link> ( )
|
||||
rule <link linkend="bbv2.reference.class.abstract-target.location">location</link> ( )
|
||||
rule <link linkend="bbv2.reference.class.abstract-target.full-name">full-name</link> ( )
|
||||
|
||||
# Methods inherited from <link linkend="bbv2.reference.class.basic-target">basic-target</link>
|
||||
rule <link linkend="bbv2.reference.class.basic-target.generate">generate</link> ( property-set )
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
<link linkend="bbv2.reference.class.typed-target">typed-target</link>
|
||||
is the most common kind of target alternative. Rules for creating
|
||||
typed targets are defined automatically for each type.
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
|
||||
<listitem id="bbv2.reference.class.typed-target.__init__">
|
||||
<code language="jam">rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * )</code>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>name</literal></term>
|
||||
<listitem><para>The name of the target</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>project</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <link linkend="bbv2.reference.class.project-target">project</link>
|
||||
in which the target is declared.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>type</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <link linkend="bbv2.reference.modules.type">type</link>
|
||||
of the target.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem id="bbv2.reference.class.typed-target.type">
|
||||
<indexterm zone="bbv2.reference.class.typed-target.type">
|
||||
<primary>type</primary>
|
||||
<secondary>Typed Target Method</secondary>
|
||||
</indexterm>
|
||||
<code language="jam">rule type ( )</code>
|
||||
<para>
|
||||
Returns the <link linkend="bbv2.reference.modules.type">type</link>
|
||||
of the target.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem id="bbv2.reference.class.typed-target.construct">
|
||||
<indexterm zone="bbv2.reference.class.typed-target.construct">
|
||||
<primary>construct</primary>
|
||||
<secondary>Typed Target Method</secondary>
|
||||
</indexterm>
|
||||
<code language="jam">rule construct ( name : source-targets * : property-set )</code>
|
||||
<para>
|
||||
Implements <link linkend="bbv2.reference.class.basic-target.construct">
|
||||
basic-target.construct</link>. Attempts to create a target of
|
||||
the correct type using generators appropriate for the given
|
||||
<link linkend="bbv2.reference.class.property-set">property-set</link>.
|
||||
Returns a <link linkend="bbv2.reference.class.property-set">
|
||||
property-set</link> containing the usage requirements
|
||||
and a list of virtual targets.
|
||||
|
||||
<note>
|
||||
<para>
|
||||
This function is invoked automatically by
|
||||
<link linkend="bbv2.reference.class.basic-target.generate">basic-target.generate</link>
|
||||
and should not be called directly by users.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</orderedlist>
|
||||
|
||||
</section>
|
||||
Reference in New Issue
Block a user