1[[bbv2.reference.class.project-target]]
2= Class project-target
3
4[source,jam]
5----
6class project-target : abstract-target {
7    rule generate ( property-set )
8    rule build-dir ( )
9    rule main-target ( name )
10    rule has-main-target ( name )
11    rule find ( id : no-error ? )
12
13    # Methods inherited from abstract-target
14    rule name ( )
15    rule project ( )
16    rule location ( )
17    rule full-name ( )
18}
19----
20
21This class has the following responsibilities:
22
23* Maintaining a list of main targets in this project and building them.
24
25--
261. [[bbv2.reference.class.project-target.generate]] `rule generate ( property-set )`
27+
28Overrides
29link:#bbv2.reference.class.abstract-target.generate[abstract-target.generate].
30Generates virtual targets for all the targets contained in this project.
31+
32On success, returns:
33+
34* a property-set with the usage requirements to be applied to dependents
35* a list of produced virtual targets, which may be empty.
36
372. `rule build-dir ( )`
38+
39Returns the root build directory of the project.
40
413. `rule main-target ( name )`
42+
43Returns a link:#bbv2.reference.class.main-target[main-target] class
44instance corresponding to `name`. Can only be called after the project
45has been fully loaded.
46
474. `rule has-main-target ( name )`
48+
49Returns whether a link:#bbv2.reference.class.main-target[main-target]
50with the specified name exists. Can only be called after the project has
51been fully loaded.
52
535. `rule find ( id : no-error ? )`
54+
55Find and return the target with the specified id, treated relative to
56self. Id may specify either a target or a file name with the target
57taking priority. May report an error or return nothing if the target is
58not found depending on the `no-error` parameter.
59--
60