Next: External References in Project Files, Previous: Project Extension, Up: GNAT Project Manager
When extending a large system spanning multiple projects, it is often
inconvenient to extend every project in the hierarchy that is impacted by a
small change introduced. In such cases, it is possible to create a virtual
extension of entire hierarchy using extends all
relationship.
When the project is extended using extends all
inheritance, all projects
that are imported by it, both directly and indirectly, are considered virtually
extended. That is, the Project Manager creates "virtual projects"
that extend every project in the hierarchy; all these virtual projects have
no sources of their own and have as object directory the object directory of
the root of "extending all" project.
It is possible to explicitly extend one or more projects in the hierarchy in order to modify the sources. These extending projects must be imported by the "extending all" project, which will replace the corresponding virtual projects with the explicit ones.
When building such a project hierarchy extension, the Project Manager will ensure that both modified sources and sources in virtual extending projects that depend on them, are recompiled.
By means of example, consider the following hierarchy of projects.
We want to modify packages P1 and P3.
This project hierarchy will need to be extended as follows:
project A1 extends "(...)/A" is end A1;
with "(...)/A1"; project C1 extends all "(...)/C" is end C1;
When you build project C1, your entire modified project space will be recompiled, including the virtual project B1 that has been impacted by the "extending all" inheritance of project C.
Note that if a Library Project in the hierarchy is virtually extended, the virtual project that extends the Library Project is not a Library Project.