| 134 | | Porting is in progress yet. Check back later. |
| | 134 | [Note that 'project' is basically a directory where either Jamroot or Jamfile is present]. |
| | 135 | Project loading is implemented by the {{{boost.build.build.project}}} module. The {{{ProjectRegistry}}} class maintains all known projects. The {{{Manager.projects()}}} method obtains the project registry for a manager. |
| | 136 | The {{{ProjectRegistry.load}}} method load a project at specific directory. Each project is associated with a Jam module where |
| | 137 | the Jamfile code is execute, with a project target, and a attributes object {{{ProjectAttributes}}} -- which keeps things like project requirements. |
| | 138 | The attributes object is carried over from previous design, and will be eventually merged with the project target. |
| | 139 | |
| | 140 | Loading of project follows these steps: |
| | 141 | 1. Find Jamfile or Jamroot |
| | 142 | 2. Prepare default attributes object, where all attribute are inherited from parent. Create new project target. |
| | 143 | 3. Import all functions that must be useable in Jamfile context to Jam module for the new project |
| | 144 | 4. Actually load the Jamfile. |
| | 145 | |
| | 146 | If a Jamfile contains call to the 'project' rule, all specified attributes are passed to the {{{ProjectAttributes}}} object, which |
| | 147 | adjust attributes. For example, for requirements, the properties specified in the 'project' rule are merged with the properties inherited from parent. |
| | 148 | |
| | 149 | The list of functions that must be callable from Jamfile is maintained by the {{{ProjectRules}}} class. It has several method that |
| | 150 | are automatically imported in Jamfile, as well as the {{{add_rule}}} method that can be called from anywhere. The {{{add_rule}}} |
| | 151 | method takes a name that must be available in Jamfile, and a callable that will be called. This is the mechanism used to make |
| | 152 | various main target rules available in Jamfile. |
| | 153 | |
| | 154 | The callables imported into Jamfile will be called with exactly parameters passed in Jamfile -- there are no extra parameters implicitly added. While a Jamfile is being loaded, the {{{ProjectRegistry.current}}} method will return project target corresponding to the |
| | 155 | currently loaded Jamfile. Main target rules should use it to decide in which project targets should be defined. |