GNATbench provides the standard project builder commands defined by Eclipse, with some changes for the sake of building in the context of a distinct linking phase, and also adds additional builder commands. All these commands display their execution in the Console and any compilation warnings and errors are reported in the Problems View.
The Project menu and the Navigator contextual menu provide the standard Eclipse project commands and GNATbench implements the standard semantics. These are the menu entries "Build All" through "Build Automatically" in the Project menu and "Build Project" in the contextual menu. See Project Build Command Menus for the locations and content of these menus.
The various build commands and the "Clean..." command operate based on the build history, that is, they perform their action only if Eclipse believes them necessary. Indeed, the build commands will be disabled whenever a build previously succeeded and nothing has changed to make Eclipse believe another build is necessary.
The commands "Build Project" and "Build All" will invoke the version of "gnatmake" defined by the GNAT compiler specified by the user when creating the project. Alternatively, if a foreign compiler is specified during project creation, the corresponding command specified by the user will be invoked.
Similarly, the Eclipse "Clean..." command in the Project menu invokes either the GNAT compiler's version of "gnatclean" or the command specified by the user during project creation. (The "Clean..." command offers the option to clean all projects or just a subset of selected projects.)
We describe the semantics of "Build Automatically" in a separate section of this Building chapter. See About the Build Automatically Option for the details.
GNATbench defines addition builder commands that provide the convenience of operating specifically on the currently selected project. These enhancements appear in the next section down in the Project menu and at the bottom of the Ada Project Explorer and Navigator contextual menus. (See the figures above.)
The "Build Current Project" command will build the project using the GNAT tools to determine whether a build is truly necessary. Unlike the standard Eclipse command, it will invoke the builder regardless of whether a previous build succeeded. The command invokes the same version of "gnatmake" that the standard Eclipse build command (described above) invokes, and, as a result, a full build will only occur if truly necessary.
The "Clean Current Project" command simply cleans the project, like the standard command, but does not offer the option to clean more than that one project. Like the standard Eclipse "Clean..." command, however, it calls "gnatclean" for the actual compiler defined for the project. If a foreign compiler is specified during project creation the user-defined command will be invoked.
The "Rebuild Current Project" command simply first performs a "Clean Current Project" command and then invokes the builder. A full build is thus performed.
The "Analyze Project Sources" command will check all the sources in the project, including those that have not changed, for syntax and semantic errors. Any warnings and errors are sent to the problems view as usual. Note that this command does not create an executable.
The "Build Target In Project..." command allows you to invoke user-defined builder commands. We cover the details of this command in a separate part of this "Building" chapter. See User-Defined Builder Commands for the details.
Note that there is no compelling reason to use "Build Target In Project..." to invoke the builder commands defined by Eclipse and GNATbench. This menu entry is intended for invoking user-defined builder commands.