File: building.rst

package info (click to toggle)
gnat-gps 18-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,716 kB
  • sloc: ada: 362,679; python: 31,031; xml: 9,597; makefile: 1,030; ansic: 917; sh: 264; java: 17
file content (45 lines) | stat: -rw-r--r-- 2,216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
*********************
Building applications
*********************

Select the icon `Build Main: sdc.adb` on the toolbar (fourth icon from the
right): this will launch a complete build of the *sdc* application. Note also
that you can use a key binding directly instead of this tool bar button
(:kbd:`F4`), or use the corresponding menu item `Build->Project->Sdc->sdc.adb`.
If you use the menu item, an extra intermediate dialog is displayed showing the
actual command line that will be used by GPS. Pressing :kbd:`Execute` will
launch the build as well.

The build has generated a number of errors in a new window: the *Locations*
tree, displayed in the bottom area. The errors are also highlighted in the
corresponding source editor.

GPS has automatically jumped to the first error message (*sdc.adb, 28:6  :
(style) bad indentation*), at the line (28) and column (6) of the error.

Fix the error by hand by inserting a space.

Now you can fix the next error by moving the cursor to the line 30 (press the
:kbd:`down` arrow twice), and by using :kbd:`Tab`: this key
shortcut asks the source editor to automatically re-indent the current line.

Note that you can change this shortcut from the key shortcuts section of the
Preferences dialog (menu `Edit->Preferences`, `General/Key shortcuts` section,
`Format Selection` item).

You can then fix all the remaining errors by selecting the whole block (from
line 28 to line 40) and pressing :kbd:`Tab`. To select a block, you can
either click on the left mouse button and select the area while holding the
button, or using the keyboard by pressing the :kbd:`Shift` key and moving the
cursor using the :kbd:`Up` or :kbd:`Down` keys.

Press the :kbd:`F4` key to build again. GPS will automatically save the
modified files, and start a build. This behavior (automatic saving of files
before building) can be configured in the preferences dialog.

If you look to the right of the toolbar in the GPS window, next to the
omni-search entry, you will notice that a progress bar has appeared,
displaying the current number of files compiled, and the number of remaining
files. This progress bar disappears when the build is finished.

This should now report a successful build.