Importing Existing GNAT Projects for the GPP Platform

Importing existing GNAT projects (i.e., those defined by a GNAT project file), is accomplished using a wizard provided by GNATbench.

To invoke the wizard you may use either the "File" menu and select "Import...", or use the contextual menu in the Project Navigator and again select "Import..." The first approach is illustrated below.

file import menu

A new wizard page will appear (shown below), allowing you to choose which import wizard to apply. Workbench defines a number of import wizards so you may need to expand the "Other" category. Select "Existing GNAT Project" and press Next.

import wizard selection page

The next wizard page appears (see the following figure) and requests the location of the GNAT project file defining the project to be imported. You may either enter the path manually or browse to it via the "Browse" button to the right of the text entry pane.

import gnat project selection page

On that same page you also choose whether to import the GNAT project into an existing Workbench project or into a new Workbench project. For new projects you can have the Workbench New Project wizard configure the new project as well.

That page also offers the choice of whether to copy the files of the GNAT project into the Workbench project or only create links to the existing files. Be sure to choose "Copy project files into workspace" rather than the alternative of creating links to the files. Workbench projects do not work well with linked files.

In all foreseeable cases you should have the Workbench New Project wizard configure your new project so that you can then build and debug it. Otherwise, it is simply an Eclipse project and not a Wind River project. Make sure to choose one of the Wind River Workbench New Project wizards, not one of the GNAT Pro New Project wizards. The GNAT Pro New Project wizards start from the very beginning and create everything required to make a new project. In contrast, importing a GNAT project requires some of the project infrastructure to already exist and so it should be neither replicated nor lost. The following figure illustrates selection of a wizard that will configure the project for VxWorks 6 as a Downloadable Kernel Module project:

selecting a WRS new project wizard

Press Finish after making all these choices. The Workbench New Project wizard will be invoked automatically if you requested it, and then the new project will be created for you.

Assuming you use a WRS New Project wizard to configure your project, the wizard will ask for the name of this new project. You must specify a project name that exactly matches the name of the GNAT project file you are importing. For example, if you import a GNAT project file named "ms1553_demo.gpr", you must name the new project "ms1553_demo". Otherwise the project build command will not invoke the Ada builder.

Note that you may have to modify the GNAT project file created by the wizard. For example, you might need to respecify the location of the executable (a directory) if the original GNAT project file specified it with an absolute path. Similarly, the GNAT project file might specify multiple main programs or other properties that should be changed.