7.3. Compiling Individual Files

The GNATbench Ada editor extends the contextual menu with an entry “Compile Ada File” that will compile the current file opened in the editor. The progress indicator at the lower right of Workbench will show the command as it runs.

wrs compile file editor menu

The compilation steps are displayed on the standard Eclipse Console in a subconsole specific to the command. Note this is not the Workbench Build Console, it is within the Eclipse Console view. You can show this view using the standard Eclipse Window -> Show View command if the Console is not already open.

You can also analyze the file so that browsing and navigation are supported, as well as indicating any syntax or semantic errors, without involving actual code generation. The Analyze Ada File will invoke the operation; the output will appear as for the Compile command.

For both the compilation and analysis file commands, the compiler actually invoked is determined by the project default toolchain. This toolchain need not be the the one invoked when building the entire project. For example, you might want to use a more recent version of the compiler for the sake of additional capabilities, or you might want to use a completely different compiler targeted to a different architecture (e.g., a “native” compiler). To apply multiple toolchains see Using Multiple Toolchains `