Project files have a simple syntax; they may be edited directly. Each line specifies a project variable name and its value, separated by “=”:
Some variables (like
src_dir) are lists; multiple occurrences
There must be no space between the variable name and “=”, and no trailing spaces.
Alternately, a GUI editor for project files is available (see GUI Editor). It uses Emacs widgets, similar to Emacs customize.
The GUI editor also provides a convenient way to view current project settings, if they have been modified using menu commands rather than by editing the project file.
After the first Ada mode build command is invoked, there is always a
current project file, given by the lisp variable
ada-prj-default-project-file. Currently, the only way to show
the current project file is to invoke the GUI editor.
To find the project file the first time, Ada mode uses the following search algorithm:
ada-prj-default-project-fileis set, use that.
This algorithm always sets
when the file does not actually exist.
To change the project file before or after the first one is found, invoke ‘Ada | Project | Load ...’.
Or, in lisp, evaluate
ada-prj-default-project-file, and reads the project file.
You can also specify a GNAT project file to ‘Ada | Project | Load
ada-set-default-project-file. Emacs Ada mode checks the
file extension; if it is
.gpr, the file is treated as a GNAT
project file. Any other extension is treated as an Emacs Ada mode