Next: Library Projects, Previous: Variables from Imported Projects, Up: GNAT Project Manager
Sometimes an Ada software system is ported from a foreign compilation
environment to GNAT, with file names that do not use the default GNAT
conventions. Instead of changing all the file names (which for a variety of
reasons might not be possible), you can define the relevant file naming scheme
in the Naming
package in your project file. For example, the following
package models the Apex file naming rules:
package Naming is for Casing use "lowercase"; for Dot_Replacement use "."; for Specification_Suffix ("Ada") use ".1.ada"; for Implementation_Suffix ("Ada") use ".2.ada"; end Naming;
You can define the following attributes in package Naming
:
"lowercase"
,
"uppercase"
or "mixedcase"
; these strings are case insensitive.
If Casing is not specified, then the default is "lowercase"
.
'.'
except if it the entire string is "."
If Dot_Replacement
is not specified, then the default is "-"
.
Specification_Suffix ("Ada")
is not specified, then the default is
".ads"
.
Specification_Suffix
Implementation_Suffix ("Ada")
is not specified, then the default is
".adb"
.
Implementation_Suffix
.
If Separate_Suffix ("Ada")
is not specified, then it defaults to same
value as Implementation_Suffix ("Ada")
.
Specification
attribute, an associative array, to define
the source file name for an individual Ada compilation unit's spec. The array
index must be a string literal that identifies the Ada unit (case insensitive).
The value of this attribute must be a string that identifies the file that
contains this unit's spec (case sensitive or insensitive depending on the
operating system).
for Specification ("MyPack.MyChild") use "mypack.mychild.spec";
Implementation
attribute, an associative array, to
define the source file name for an individual Ada compilation unit's body
(possibly a subunit). The array index must be a string literal that identifies
the Ada unit (case insensitive). The value of this attribute must be a string
that identifies the file that contains this unit's body or subunit (case
sensitive or insensitive depending on the operating system).
for Implementation ("MyPack.MyChild") use "mypack.mychild.body";