File: objects.adb

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 (88 lines) | stat: -rw-r--r-- 2,606 bytes parent folder | download | duplicates (2)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
with GNATCOLL.Projects; use GNATCOLL.Projects;
with GNATCOLL.Traces;   use GNATCOLL.Traces;
with GNATCOLL.VFS;      use GNATCOLL.VFS;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.IO; use GNAT.IO;  --  not text_IO, to avoid CR+LF

procedure Objects is
   use Library_Info_Lists;
   Tree : Project_Tree;
   LIs  : Library_Info_List;
   C    : Library_Info_Lists.Cursor;
   Current_Dir : constant Virtual_File := Get_Current_Dir;
begin
   Parse_Config_File;
   Tree.Load (Create ("extending.gpr"));

   LIs.Clear;
   Tree.Root_Project.Library_Files
      (Recursive          => True,
       List               => LIs,
       Exclude_Overridden => True);
   C := First (LIs);
   while Has_Element (C) loop
      Put_Line ("recursive from root LI="
         & Format_Pathname
            (+Relative_Path (Element (C).Library_File, Current_Dir),
             UNIX));
      Next (C);
   end loop;

   LIs.Clear;
   Tree.Root_Project.Library_Files
      (Recursive          => True,
       List               => LIs,
       Exclude_Overridden => False);
   C := First (LIs);
   while Has_Element (C) loop
      Put_Line ("recursive from root, show overridden, LI="
         & Format_Pathname
            (+Relative_Path (Element (C).Library_File, Current_Dir),
             UNIX));
      Next (C);
   end loop;

   LIs.Clear;
   Tree.Root_Project.Library_Files
      (Recursive          => False,
       List               => LIs,
       Exclude_Overridden => True);
   C := First (LIs);
   while Has_Element (C) loop
      Put_Line ("non recursive from root LI="
         & Format_Pathname
            (+Relative_Path (Element (C).Library_File, Current_Dir),
             UNIX));
      Next (C);
   end loop;

   LIs.Clear;
   Tree.Project_From_Name ("extended").Library_Files
      (Recursive          => False,
       List               => LIs,
       Exclude_Overridden => True);
   C := First (LIs);
   while Has_Element (C) loop
      Put_Line ("non recursive from extended LI="
         & Format_Pathname
            (+Relative_Path (Element (C).Library_File, Current_Dir),
             UNIX));
      Next (C);
   end loop;

   LIs.Clear;
   Tree.Project_From_Name ("extended").Library_Files
      (Recursive          => False,
       List               => LIs,
       Exclude_Overridden => False);
   C := First (LIs);
   while Has_Element (C) loop
      Put_Line ("non recursive from extended, show overridden, LI="
         & Format_Pathname
            (+Relative_Path (Element (C).Library_File, Current_Dir),
             UNIX));
      Next (C);
   end loop;


end Objects;