Fix #1, +AdaYaml

This commit is contained in:
Alejandro R Mosteo
2018-03-20 19:18:04 +01:00
parent e23754b3d1
commit dc993d232b
19 changed files with 180 additions and 146 deletions
+2 -3
View File
@@ -26,9 +26,8 @@ package Alire.Index.Ada_Lua is
License (GPL_3_0),
Private_Properties =>
GPR_File ("lua.gpr") and
GPR_File ("examples/example1/example1.gpr") and
GPR_File ("examples/example2/example2.gpr")
Project_File ("examples/example1/example1.gpr") and
Project_File ("examples/example2/example2.gpr")
);
end Alire.Index.Ada_Lua;
+36
View File
@@ -0,0 +1,36 @@
with Alire.Index.AUnit;
package Alire.Index.AdaYaml is
function Project is new Catalogued_Project (Projects.AdaYaml);
Prj_Repo : constant URL := "https://github.com/yaml/AdaYaml.git";
Prj_Author : constant String := "Felix Krause";
Prj_Website : constant URL := "https://ada.yaml.io/";
V_0_2 : constant Release :=
Project.Register
(V ("0.2"),
Git (Prj_Repo, "0264b03fd92eeedfe3e2713ed1da3f0d255c1727"),
Dependencies =>
AUnit.Project >= AUnit.V_2017,
Properties =>
Project_File ("yaml.gpr") and
Project_File ("yaml-utils.gpr") and
GPR_Scenario ("Mode", "debug" or "release") and
Author (Prj_Author) and
Website (Prj_Website) and
License (MIT),
Private_Properties =>
Project_File ("yaml-tests.gpr") and
Executable ("yaml-lexer-harness") and
Executable ("yaml-parser-harness")
);
end Alire.Index.AdaYaml;
+3 -3
View File
@@ -61,17 +61,17 @@ package Alire.Index.Alire is
GPR_Free_Scenario ("Path_To_Something") and
-- Known scenario variables
GPR_File ("scenarios/catastrophical.gpr") and
Project_File ("scenarios/catastrophical.gpr") and
-- Way to specify a project file not named like the project
-- Path separators are always "/" and internally converted to native ones
On_Condition
(Operating_System = Windows,
GPR_File ("project_win.gpr")) and
Project_File ("project_win.gpr")) and
On_Condition
(Operating_System = GNU_Linux,
On_Condition (Distribution = Ubuntu, -- Nested conditions
GPR_File ("project_ubuntu.gpr"))) and
Project_File ("project_ubuntu.gpr"))) and
-- Conditional project file
On_Condition
+3 -2
View File
@@ -9,6 +9,8 @@ package Alire.Index.APQ is
(V ("3.2.0"),
Git (Repo, "3b5b4b99f528f853e02abf239da7db3d8c9962b4"),
Properties =>
Project_File ("apq.gpr") and
GPR_Scenario ("OS", "Windows_NT" or "GNU/Linux" or "Darwin") and
GPR_Scenario ("DEBUG", "true" or "false") and
@@ -16,8 +18,7 @@ package Alire.Index.APQ is
License (GMGPL_3_0),
Private_Properties =>
GPR_File ("apq.gpr") and
GPR_File ("samples/apq-samples.gpr")
Project_File ("samples/apq-samples.gpr")
);
end Alire.Index.APQ;
+15 -14
View File
@@ -14,6 +14,8 @@ package Alire.Index.AUnit is
GPR_Scenario ("RUNTIME",
"full" or "zfp" or "ravenscar" or "ravenscar-cert" or "cert") and
Project_File ("aunit.gpr") and
Executable ("aunit_harness") and
Executable ("run-ppc-elf") and
Executable ("test_liskov") and
@@ -25,21 +27,20 @@ package Alire.Index.AUnit is
License (GPL_3_0),
Private_Properties =>
GPR_File ("aunit.gpr") and
GPR_File ("test/aunit_tests.gpr") and
Project_File ("test/aunit_tests.gpr") and
GPR_File ("examples/calculator/harness.gpr") and
GPR_File ("examples/calculator/tested_lib/testlib.gpr") and
GPR_File ("examples/failures/harness.gpr") and
GPR_File ("examples/failures/tested_lib/testlib.gpr") and
GPR_File ("examples/liskov/harness.gpr") and
GPR_File ("examples/liskov/tested_lib/testlib.gpr") and
GPR_File ("examples/simple_test/harness.gpr") and
GPR_File ("examples/simple_test/tested_lib/testlib.gpr") and
GPR_File ("examples/test_caller/harness/harness.gpr") and
GPR_File ("examples/test_caller/tested_lib/testlib.gpr") and
GPR_File ("examples/test_fixture/harness.gpr") and
GPR_File ("examples/test_fixture/tested_lib/testlib.gpr")
Project_File ("examples/calculator/harness.gpr") and
Project_File ("examples/calculator/tested_lib/testlib.gpr") and
Project_File ("examples/failures/harness.gpr") and
Project_File ("examples/failures/tested_lib/testlib.gpr") and
Project_File ("examples/liskov/harness.gpr") and
Project_File ("examples/liskov/tested_lib/testlib.gpr") and
Project_File ("examples/simple_test/harness.gpr") and
Project_File ("examples/simple_test/tested_lib/testlib.gpr") and
Project_File ("examples/test_caller/harness/harness.gpr") and
Project_File ("examples/test_caller/tested_lib/testlib.gpr") and
Project_File ("examples/test_fixture/harness.gpr") and
Project_File ("examples/test_fixture/tested_lib/testlib.gpr")
);
end Alire.Index.AUnit;
+19 -35
View File
@@ -49,8 +49,7 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("strings_edit.gpr") and
GPR_File ("test_strings_edit/strings_edit-test.gpr")
Project_File ("test_strings_edit/strings_edit-test.gpr")
);
Tables_V_4_27 : constant Release :=
@@ -70,8 +69,7 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("tables.gpr") and
GPR_File ("test_tables/tables-test.gpr")
Project_File ("test_tables/tables-test.gpr")
);
Components_V_4_27 : constant Release :=
@@ -125,8 +123,7 @@ package Alire.Index.DAK_Components is
Comment ("Tasking=Single seems to be broken at persistent-single_file-text_io.adb"),
Private_Properties =>
GPR_File ("components.gpr") and
GPR_File ("test_components/components-tests.gpr")
Project_File ("test_components/components-tests.gpr")
);
Components_NTP_V_4_27 : constant Release :=
@@ -146,8 +143,7 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("components-ntp.gpr") and
GPR_File ("test_components/components-ntp-test_ntp.gpr")
Project_File ("test_components/components-ntp-test_ntp.gpr")
);
Components_Sqlite_V_4_27 : constant Release :=
@@ -168,9 +164,8 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("components-sqlite.gpr") and
GPR_File ("test_components/components-sqlite-benchmark_tests.gpr") and
GPR_File ("test_components/components-sqlite-sqlite_persistence_tests.gpr")
Project_File ("test_components/components-sqlite-benchmark_tests.gpr") and
Project_File ("test_components/components-sqlite-sqlite_persistence_tests.gpr")
);
Components_Connections_V_4_27 : constant Release :=
@@ -213,24 +208,16 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("components-connections_server.gpr") and
GPR_File ("components-connections_server-elv_max_cube.gpr") and
GPR_File ("components-connections_server-http_server.gpr") and
GPR_File ("components-connections_server-http_server-sqlite_browser.gpr") and
GPR_File ("components-connections_server-modbus.gpr") and
GPR_File ("components-connections_server-mqtt.gpr") and
GPR_File ("components-connections_server-smtp.gpr") and
-- Test projects
GPR_File ("test_components/components-connections_server-elv_max_cube-test_elv_max_cube_client.gpr") and
GPR_File ("test_components/components-connections_server-http_server-test_http_server.gpr") and
GPR_File ("test_components/components-connections_server-modbus-test_modbus_client.gpr") and
GPR_File ("test_components/components-connections_server-mqtt-test_mqtt.gpr") and
GPR_File ("test_components/components-connections_server-test_data_server.gpr") and
GPR_File ("test_components/components-connections_server-test_echo_client_async.gpr") and
GPR_File ("test_components/components-connections_server-test_echo_client.gpr") and
GPR_File ("test_components/components-connections_server-test_echo_server.gpr") and
GPR_File ("test_components/components-connections_server-test_websockets_mqtt.gpr") and
GPR_File ("test_components/components-test_sqlite_browser.gpr")
Project_File ("test_components/components-connections_server-elv_max_cube-test_elv_max_cube_client.gpr") and
Project_File ("test_components/components-connections_server-http_server-test_http_server.gpr") and
Project_File ("test_components/components-connections_server-modbus-test_modbus_client.gpr") and
Project_File ("test_components/components-connections_server-mqtt-test_mqtt.gpr") and
Project_File ("test_components/components-connections_server-test_data_server.gpr") and
Project_File ("test_components/components-connections_server-test_echo_client_async.gpr") and
Project_File ("test_components/components-connections_server-test_echo_client.gpr") and
Project_File ("test_components/components-connections_server-test_echo_server.gpr") and
Project_File ("test_components/components-connections_server-test_websockets_mqtt.gpr") and
Project_File ("test_components/components-test_sqlite_browser.gpr")
);
Components_Connections_Secure_V_4_27 : constant Release :=
@@ -254,10 +241,8 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("components-connections_server-secure.gpr") and
GPR_File ("components-gnutls.gpr") and
GPR_File ("test_components/components-connections_server-http_server-test_https_server.gpr") and
GPR_File ("test_components/components-connections_server-smtp-test_smtp.gpr")
Project_File ("test_components/components-connections_server-http_server-test_https_server.gpr") and
Project_File ("test_components/components-connections_server-smtp-test_smtp.gpr")
);
Components_ODBC_V_4_27 : constant Release :=
@@ -278,8 +263,7 @@ package Alire.Index.DAK_Components is
Website (DAK_Website),
Private_Properties =>
GPR_File ("components-odbc.gpr") and
GPR_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and
Project_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and
On_Condition
(Operating_System = GNU_Linux,
+1 -4
View File
@@ -21,10 +21,7 @@ package Alire.Index.Eagle_Lander is
Author (Prj_Author) and
Website (Prj_Website) and
License (GPL_3_0),
Private_Properties =>
GPR_File ("lunar_lander.gpr")
License (GPL_3_0)
);
end Alire.Index.Eagle_Lander;
+5 -5
View File
@@ -18,6 +18,7 @@ package Alire.Index.Globe_3D is
Properties =>
Project_File ("globe_3d.gpr") and
GPR_Scenario ("OS_Kind", "linux" or "macosx" or "win32") and
Executable ("globe_3d_demo") and
@@ -31,11 +32,10 @@ package Alire.Index.Globe_3D is
License (Unknown),
Private_Properties =>
GPR_File ("globe_3d.gpr") and
GPR_File ("demo/culler/armada/armada.gpr") and
GPR_File ("demo/globe_3d_demos.gpr") and
GPR_File ("demo/multi_window/multi_window.gpr") and
GPR_File ("demo/sprite/sprite_demo.gpr") and
Project_File ("demo/culler/armada/armada.gpr") and
Project_File ("demo/globe_3d_demos.gpr") and
Project_File ("demo/multi_window/multi_window.gpr") and
Project_File ("demo/sprite/sprite_demo.gpr") and
On_Condition
(Operating_System = GNU_Linux,
+3 -2
View File
@@ -16,6 +16,8 @@ package Alire.Index.Libadacrypt is
AUnit.V_2017.Within_Major,
Properties =>
Project_File ("libadacrypt.gpr") and
GPR_Scenario ("system", "unix" or "windows") and
GPR_Scenario ("mode", "debug" or "release") and
@@ -30,8 +32,7 @@ package Alire.Index.Libadacrypt is
License (GMGPL_3_0),
Private_Properties =>
GPR_File ("libadacrypt.gpr") and
GPR_File ("acltest.gpr") and
Project_File ("acltest.gpr") and
On_Condition
(Operating_System = GNU_Linux,
-5
View File
@@ -42,11 +42,6 @@ package Alire.Index.OpenGLAda is
License (MIT),
Private_Properties =>
GPR_File ("opengl.gpr") and
GPR_File ("opengl-glfw.gpr") and
GPR_File ("opengl-soil.gpr") and
GPR_File ("opengl-test.gpr") and
On_Condition
(Operating_System = GNU_Linux, GPR_External ("Windowing_System", "x11")),
+6 -10
View File
@@ -18,7 +18,7 @@ package Alire.Index.SDLAda is
LibSDL2.SDL_TTF_V_2.Within_Major,
Properties =>
Project_File ("sdlada.gpr") and
Project_File ("build/gnat/sdlada.gpr") and
GPR_Scenario ("SDL_MODE", "debug" or "release") and
GPR_Scenario ("SDL_PLATFORM", "linux" or "bsd" or "windows" or "macosx" or "ios" or "android") and
@@ -27,15 +27,11 @@ package Alire.Index.SDLAda is
License (Zlib),
Private_Properties =>
GPR_Path ("build/gnat") and
GPR_File ("build/gnat/sdlada.gpr") and
-- GPR_File ("build/gnat/sdlada_image.gpr") and
GPR_File ("build/gnat/tests.gpr") and
-- GPR_File ("build/gnat/tests_image.gpr") and
GPR_File ("build/gnat/test_maths_build.gpr") and
-- GPR_File ("build/gnat/tools.gpr") and
-- GPR_File ("build/gnat/unit_tests.gpr") and
Project_File ("build/gnat/tests.gpr") and
-- Project_File ("build/gnat/tests_image.gpr") and
Project_File ("build/gnat/test_maths_build.gpr") and
-- Project_File ("build/gnat/tools.gpr") and
-- Project_File ("build/gnat/unit_tests.gpr") and
Executable ("clipboard") and
Executable ("error") and
-3
View File
@@ -24,9 +24,6 @@ package Alire.Index.Whitakers_Words is
Comment ("This package builds the binary but additional steps are needed") and
Comment ("See the README file for further instructions"),
Private_Properties =>
GPR_File ("words.gpr"),
Available_When =>
Compiler > GNAT_FSF_7_2 -- bug with SAL library failing binding
);
+12 -1
View File
@@ -8,8 +8,13 @@ package Alire.Projects with Preelaborate is
-- Full list in alphabetical order
type Names is
(Ada_Lua,
(-------
-- A --
-------
Ada_Lua,
Adacurses,
AdaYaml,
Alire,
Alr,
APQ,
@@ -92,10 +97,16 @@ package Alire.Projects with Preelaborate is
function Description (Name : Names) return Description_String is
(case Name is
-------
-- A --
-------
when Ada_Lua =>
"An Ada binding for Lua",
when Adacurses =>
"Wrapper on different packagings of NcursesAda",
when AdaYaml =>
"Experimental YAML 1.3 implementation in Ada",
when Alire =>
"Alire project catalog and support files",
when Alr =>
+9 -10
View File
@@ -1,7 +1,8 @@
with Ada.Containers.Ordered_Maps;
with Ada.Directories;
with Ada.Strings.Maps;
with Gnat.OS_Lib;
package body Alire.Index is
use all type Version;
@@ -173,15 +174,13 @@ package body Alire.Index is
function To_Native (Path : Platform_Independent_Path) return String is
use Ada.Strings.Maps;
begin
for I in Path'Range loop
if Is_In (Path (I), Dir_Seps) then
return Ada.Directories.Compose
(Path (Path'First .. I - 1),
To_Native (Path (I + 1 .. Path'Last)));
end if;
end loop;
return Path;
return Native : String := Path do
for I in Native'Range loop
if Is_In (Path (I), Dir_Seps) then
Native (I) := GNAT.OS_Lib.Directory_Separator;
end if;
end loop;
end return;
end To_Native;
-----------
+7 -9
View File
@@ -234,13 +234,12 @@ package Alire.Index is
function Comment is new PL.Cond_New_Label (Properties.Labeled.Comment);
function Executable is new PL.Cond_New_Label (Properties.Labeled.Executable);
function Maintainer is new PL.Cond_New_Label (Properties.Labeled.Maintainer);
function Project_File is new PL.Cond_New_Label (Properties.Labeled.Project_File);
function Website is new PL.Cond_New_Label (Properties.Labeled.Website);
function U (Prop : Properties.Vector) return Conditional.Properties
renames Conditional.For_Properties.New_Value;
-- Non-label attributes require a custom builder function
-- Non-label attributes or processed data require a custom builder function
function GPR_Free_Scenario (Name : String) return Properties.Vector is (+Properties.Scenarios.New_Property (GPR.Free_Variable (Name)));
function GPR_Free_Scenario (Name : String) return Conditional.Properties is (U (GPR_Free_Scenario (Name)));
@@ -250,6 +249,9 @@ package Alire.Index is
function License (L : Licensing.Licenses) return Properties.Vector is (+Properties.Licenses.Values.New_Property (L));
function License (L : Licensing.Licenses) return Conditional.Properties is (U (License (L)));
function Project_File (File : Platform_Independent_Path) return Release_Properties;
-- Concatenate
function "and" (L, R : Release_Properties) return Release_Properties
renames Conditional.For_Properties."and";
@@ -260,9 +262,6 @@ package Alire.Index is
function GPR_External (Name : String; Value : String) return Conditional.Properties is
(U (+Properties.Scenarios.New_Property (GPR.External_Value (Name, Value))));
function GPR_File (File : Platform_Independent_Path) return Release_Properties;
function GPR_Path (Path : Platform_Independent_Path) return Release_Properties;
------------------
-- REQUISITES --
@@ -349,11 +348,10 @@ private
function Name (C : Catalog_Entry) return Projects.Names is (C.Name);
function GPR_File_Unsafe is new PL.Cond_New_Label (Properties.Labeled.GPR_File);
function GPR_Path_Unsafe is new PL.Cond_New_Label (Properties.Labeled.GPR_Path);
function Project_File_Unsafe is new PL.Cond_New_Label (Properties.Labeled.Project_File);
function GPR_File (File : Platform_Independent_Path) return Release_Properties renames GPR_File_Unsafe;
function GPR_Path (Path : Platform_Independent_Path) return Release_Properties renames GPR_Path_Unsafe;
function Project_File (File : Platform_Independent_Path) return Release_Properties is
(Project_File_Unsafe (To_Native (File)));
function Unavailable return Conditional.Dependencies is
(Conditional.For_Dependencies.New_Value -- A conditional (without condition) dependency vector
+2 -7
View File
@@ -12,13 +12,8 @@ package Alire.Properties.Labeled with Preelaborate is
Description, -- One-liner description, so it is searched too
Executable, -- A resulting executable built by the project
Maintainer, -- Info about the maintainer of the alr-packaged project
Project_File,-- GPR files that the user can use. No path. Search paths given with GPR_Path
Website, -- A website other than the repository
-- internal labels
GPR_File, -- Alternative naming of the project file (or aditional ones)
-- Those are used when testing the build, and must include full relative path
GPR_Path -- Extra path to add to the environment to look for projects
Project_File,-- Buildable project files in the release, with full relative path
Website -- A website other than the repository
);
type Label (<>) is new Properties.Property with private;
+46 -23
View File
@@ -62,36 +62,59 @@ package body Alire.Releases is
end return;
end Executables;
---------------
-- GPR_Files --
---------------
function GPR_Files (R : Release;
P : Properties.Vector)
return Utils.String_Vector is
begin
return Files : Utils.String_Vector := Values (R.All_Properties.Evaluate (P), GPR_File) do
if Files.Is_Empty then
Files.Append (R.Project & ".gpr");
end if;
end return;
end GPR_Files;
-------------------
-- Project_Files --
-------------------
function Project_Files (R : Release;
P : Properties.Vector)
return Utils.String_Vector is
function Project_Files (R : Release;
P : Properties.Vector;
With_Path : Boolean)
return Utils.String_Vector
is
use Utils;
With_Paths : Utils.String_Vector := Values (R.All_Properties.Evaluate (P), Project_File);
Without : Utils.String_Vector;
begin
return Files : Utils.String_Vector := Values (R.All_Properties.Evaluate (P), Project_File) do
if Files.Is_Empty then
Files.Append (R.Project & ".gpr");
end if;
end return;
if With_Paths.Is_Empty then
With_Paths.Append (String'(R.Project & ".gpr"));
end if;
if With_Path then
return With_Paths;
else
for File of With_Paths loop
-- Has path or not
if Tail (File, '/') = "" then
Without.Append (File); -- As is
else
Without.Append (Tail (File, '/'));
end if;
end loop;
return Without;
end if;
end Project_Files;
-------------------
-- Project_Paths --
-------------------
function Project_Paths (R : Release;
P : Properties.Vector) return Utils.String_Set
is
use Utils;
Files : constant String_Vector := Project_Files (R, P, With_Path => True);
begin
return Paths : String_Set do
for File of Files loop
if Contains (File, "/") then
Paths.Include (Head (File, '/'));
end if;
end loop;
end return;
end Project_Paths;
------------------------
-- Labeled_Properties --
------------------------
+7 -10
View File
@@ -58,18 +58,15 @@ package Alire.Releases with Preelaborate is
-- Only explicity declared ones
-- Under some conditions (usually current platform)
function GPR_Files (R : Release;
P : Properties.Vector)
return Utils.String_Vector;
-- Explicitly declared ones, or default one if none declared
-- Under some conditions (usually current platform)
-- These have full paths to their exact location
function Project_Paths (R : Release;
P : Properties.Vector) return Utils.String_Set;
-- Deduced from Project_Files
function Project_Files (R : Release;
P : Properties.Vector)
function Project_Files (R : Release;
P : Properties.Vector;
With_Path : Boolean)
return Utils.String_Vector;
-- Informative ones, usable by anyone with-ing the library. May be anywhere in the given GPR_Path-s.
-- Only a basename without path.
-- with relative path on demand
function Image (R : Release) return Folder_String;
-- Unique string built as name_version_id
+4
View File
@@ -1,3 +1,4 @@
with Ada.Containers.Indefinite_Ordered_Sets;
with Ada.Containers.Indefinite_Vectors;
package Alire.Utils with Preelaborate is
@@ -23,6 +24,9 @@ package Alire.Utils with Preelaborate is
When_Empty : String := "(empty)";
function Image_One_Line (V : Vector) return String;
package String_Sets is new Ada.Containers.Indefinite_Ordered_Sets (String);
type String_Set is new String_Sets.Set with null record;
--------------------
-- String_Vectors --
--------------------