Compiling Individual Files

GNATbench defines menu entries for compiling individual files in addition to building complete projects.

Compilation steps and messages are displayed on the standard Eclipse Console view in a subconsole specific to the command. You can show this view using the standard Eclipse Window -> Show View command if the Console is not already open. See Viewing Command Execution for the details of using the builders' subconsoles.

The progress indicator at the lower right of the Eclipse window will show the command as it runs, including the percentage complete.

Within the Ada Editor

The GNATbench Ada editor extends the contextual menu with an entry "Compile Ada File" (shown in the figure below) that will attempt to compile the compilation unit in that file. Note the key binding in this context.

compile file editor menu

Within the GNAT Project Explorer and the Navigator

You can also compile individual Ada source files using the contextual menus of the file or construct nodes in the GNAT Project Explorer and the file nodes in the Navigator. The menu command is "Compile Ada File(s)".

Right-click on a file node in the Project Explorer or Navigator to get the file-specific contextual menu, as opposed to the project-level contextual menu.

In addition, you can compile multiple Ada source files by selecting several nodes before invoking the menu command "Compile Ada File(s)". Each file is compiled in a separate job so they may be compiled in parallel if sufficient processors are available. The figure below illustrates selecting several files within the Project Explorer for compilation.

compiling multiple files in explorer