File: projects.rst

package info (click to toggle)
libgnatcoll 1.7gpl2015-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,280 kB
  • ctags: 1,124
  • sloc: ada: 134,072; python: 4,017; cpp: 1,397; ansic: 1,234; makefile: 368; sh: 152; xml: 31; sql: 6
file content (38 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (3)
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
.. _Projects:

************************************
**Projects**: manipulating gpr files
************************************

.. highlight:: ada

The package `GNATCOLL.Projects` provides an extensive interface to
parse, manipulate and edit project files (:file:`.gpr` files).

Although the interface is best used using the Ada05 notation, it is fully
compatible with Ada95.

Here is a quick example on how to use the interface, although the spec
file itself contains much more detailed information on all the subprograms
related to the manipulation of project files::

  pragma Ada_05;
  with GNATCOLL.Projects; use GNATCOLL.Projects;
  with GNATCOLL.VFS;      use GNATCOLL.VFS;

  procedure Test_Project is
     Tree  : Project_Tree;
     Files : File_Array_Access;
  begin
     Tree.Load (GNATCOLL.VFS.Create (+"path_to_project.gpr"));

     --  List the source files for project and all imported projects

     Files := Tree.Root_Project.Source_Files (Recursive => True);
     for F in Files'Range loop
        Put_Line ("File is: " & Files (F).Display_Full_Name);
     end loop;

     Tree.Unload;
  end Test_Project;