From 251ba54ba8b2ea483bb599e5b76e77ea1f44aad9 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Wed, 7 Mar 2018 19:02:43 +0100 Subject: [PATCH] Distinct GPR/Project_File properties --- index/alire-index-apq.ads | 9 +- index/alire-index-aunit.ads | 23 ++--- index/alire-index-dak.ads | 126 ++++++++++++++++---------- index/alire-index-libadacrypt.ads | 6 +- index/alire-index-openglada.ads | 13 ++- index/alire-index-whitakers_words.ads | 36 +++++--- src/alire-releases.adb | 15 +++ src/alire-releases.ads | 9 +- 8 files changed, 150 insertions(+), 87 deletions(-) diff --git a/index/alire-index-apq.ads b/index/alire-index-apq.ads index 27e625d7..240d2d14 100644 --- a/index/alire-index-apq.ads +++ b/index/alire-index-apq.ads @@ -11,14 +11,15 @@ package Alire.Index.APQ is Desc & "(core)", Git (Repo, "3b5b4b99f528f853e02abf239da7db3d8c9962b4"), Properties => - GPR_File ("apq.gpr") and - GPR_File ("samples/apq-samples.gpr") and - GPR_Scenario ("OS", "Windows_NT" or "GNU/Linux" or "Darwin") and GPR_Scenario ("DEBUG", "true" or "false") and License (GMGPL_2_0) and - License (GMGPL_3_0) + License (GMGPL_3_0), + + Private_Properties => + GPR_File ("apq.gpr") and + GPR_File ("samples/apq-samples.gpr") ); end Alire.Index.APQ; diff --git a/index/alire-index-aunit.ads b/index/alire-index-aunit.ads index 681cb631..2b9f84a0 100644 --- a/index/alire-index-aunit.ads +++ b/index/alire-index-aunit.ads @@ -16,6 +16,17 @@ package Alire.Index.AUnit is GPR_Scenario ("RUNTIME", "full" or "zfp" or "ravenscar" or "ravenscar-cert" or "cert") and + Executable ("aunit_harness") and + Executable ("run-ppc-elf") and + Executable ("test_liskov") and + Executable ("test_calculator") and + Executable ("test_math") and + + Maintainer (Prj_Maintainer) and + Website (Prj_Website) and + License (GPL_3_0), + + Private_Properties => GPR_File ("aunit.gpr") and GPR_File ("test/aunit_tests.gpr") and @@ -30,17 +41,7 @@ package Alire.Index.AUnit is 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") and - - Executable ("aunit_harness") and - Executable ("run-ppc-elf") and - Executable ("test_liskov") and - Executable ("test_calculator") and - Executable ("test_math") and - - Maintainer (Prj_Maintainer) and - Website (Prj_Website) and - License (GPL_3_0) + GPR_File ("examples/test_fixture/tested_lib/testlib.gpr") ); end Alire.Index.AUnit; diff --git a/index/alire-index-dak.ads b/index/alire-index-dak.ads index 8d94c490..cf10f636 100644 --- a/index/alire-index-dak.ads +++ b/index/alire-index-dak.ads @@ -25,9 +25,7 @@ package Alire.Index.DAK is Desc_Pre & "(strings)" & Desc_Post, Git (Repo, "8ac67a28d666dde3a0f96b5a08a7016e4f29d491"), Properties => - - GPR_File ("strings_edit.gpr") and - GPR_File ("test_strings_edit/strings_edit-test.gpr") and + Project_File ("strings_edit.gpr") and GPR_Scenario ("Legacy", "Ada95" or "Ada2005" or "Ada2012") and GPR_Scenario ("Development", "Debug" or "Release") and @@ -38,7 +36,11 @@ package Alire.Index.DAK is License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + Website (DAK_Website), + + Private_Properties => + GPR_File ("strings_edit.gpr") and + GPR_File ("test_strings_edit/strings_edit-test.gpr") ); Tables_V_4_27 : constant Release := @@ -47,9 +49,7 @@ package Alire.Index.DAK is Desc_Pre & "(tables)" & Desc_Post, Git (Repo, "19205e4981d72242daf72da7d59c5faf2b4c91fd"), Properties => - - GPR_File ("tables.gpr") and - GPR_File ("test_tables/tables-test.gpr") and + Project_File ("tables.gpr") and GPR_Scenario ("Legacy", "Ada95" or "Ada2005" or "Ada2012") and GPR_Scenario ("Development", "Debug" or "Release") and @@ -58,7 +58,11 @@ package Alire.Index.DAK is License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + Website (DAK_Website), + + Private_Properties => + GPR_File ("tables.gpr") and + GPR_File ("test_tables/tables-test.gpr") ); Components_V_4_27 : constant Release := @@ -70,9 +74,8 @@ package Alire.Index.DAK is Within_Major (Strings_Edit_V_4_27) and Within_Major (Tables_V_4_27), - Properties => - GPR_File ("components.gpr") and - GPR_File ("test_components/components-tests.gpr") and + Properties => + Project_File ("components.gpr") and GPR_Scenario ("Atomic_Access", "Pragma-atomic" or "GCC-built-ins" or "GCC-long-offsets") and GPR_Scenario ("Tasking", "Multiple" or "Single") and @@ -111,7 +114,11 @@ package Alire.Index.DAK is License (GMGPL_2_0) and Author (DAK_Author) and Website (DAK_Website) and - Comment ("Tasking=Single seems to be broken at persistent-single_file-text_io.adb") + 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") ); Components_NTP_V_4_27 : constant Release := @@ -122,15 +129,18 @@ package Alire.Index.DAK is Dependencies => Within_Major (Components_V_4_27), - Properties => - GPR_File ("components-ntp.gpr") and - GPR_File ("test_components/components-ntp-test_ntp.gpr") and + Properties => + Project_File ("components-ntp.gpr") and Executable ("test_ntp") and License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + Website (DAK_Website), + + Private_Properties => + GPR_File ("components-ntp.gpr") and + GPR_File ("test_components/components-ntp-test_ntp.gpr") ); Components_Sqlite_V_4_27 : constant Release := @@ -141,17 +151,20 @@ package Alire.Index.DAK is Dependencies => Within_Major (Components_V_4_27), - 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") and + Properties => + Project_File ("components-sqlite.gpr") and Executable ("test_sqlite_benchmark") and Executable ("test_sqlite_persistence") and License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + 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") ); Components_Connections_V_4_27 : constant Release := @@ -163,26 +176,15 @@ package Alire.Index.DAK is Within_Major (Components_V_4_27) and Within_Major (Components_Sqlite_V_4_27), - Properties => + Properties => -- Main projects - 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") and + Project_File ("components-connections_server.gpr") and + Project_File ("components-connections_server-elv_max_cube.gpr") and + Project_File ("components-connections_server-http_server.gpr") and + Project_File ("components-connections_server-http_server-sqlite_browser.gpr") and + Project_File ("components-connections_server-modbus.gpr") and + Project_File ("components-connections_server-mqtt.gpr") and + Project_File ("components-connections_server-smtp.gpr") and Executable ("test_data_server") and Executable ("test_echo_client") and @@ -203,7 +205,27 @@ package Alire.Index.DAK is License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + 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") ); Components_Connections_Secure_V_4_27 : constant Release := @@ -215,11 +237,9 @@ package Alire.Index.DAK is Within_Major (Components_Connections_V_4_27) and Within_Major (LibGNUTLS.V_3_5_8), - 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") and + Properties => + Project_File ("components-connections_server-secure.gpr") and + Project_File ("components-gnutls.gpr") and Executable ("test_https_client") and Executable ("test_https_server") and @@ -227,7 +247,13 @@ package Alire.Index.DAK is License (GMGPL_2_0) and Author (DAK_Author) and - Website (DAK_Website) + 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") ); Components_ODBC_V_4_27 : constant Release := @@ -240,8 +266,7 @@ package Alire.Index.DAK is Current (UnixODBC.V_2_3), Properties => - GPR_File ("components-odbc.gpr") and - GPR_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and + Project_File ("components-odbc.gpr") and Executable ("test_odbc_bindings") and @@ -250,6 +275,9 @@ package Alire.Index.DAK is Website (DAK_Website), Private_Properties => + GPR_File ("components-odbc.gpr") and + GPR_File ("test_components/components-odbc-odbc_bindings_tests.gpr") and + On_Condition (System_Is (GNU_Linux), GPR_External ("odbc", "unixODBC")) and diff --git a/index/alire-index-libadacrypt.ads b/index/alire-index-libadacrypt.ads index 9e28e368..49e2fe6d 100644 --- a/index/alire-index-libadacrypt.ads +++ b/index/alire-index-libadacrypt.ads @@ -18,9 +18,6 @@ package Alire.Index.Libadacrypt is Within_Major (AUnit.V_2017), Properties => - GPR_File ("libadacrypt.gpr") and - GPR_File ("acltest.gpr") and - GPR_Scenario ("system", "unix" or "windows") and GPR_Scenario ("mode", "debug" or "release") and @@ -35,6 +32,9 @@ package Alire.Index.Libadacrypt is License (GMGPL_3_0), Private_Properties => + GPR_File ("libadacrypt.gpr") and + GPR_File ("acltest.gpr") and + On_Condition (System_Is (GNU_Linux), GPR_External ("system", "unix")) and diff --git a/index/alire-index-openglada.ads b/index/alire-index-openglada.ads index d67d6bf0..fc022cd7 100644 --- a/index/alire-index-openglada.ads +++ b/index/alire-index-openglada.ads @@ -22,10 +22,10 @@ package Alire.Index.OpenGLAda is Within_Major (Libglfw3.V_3) and Within_Major (LibX11.V_2)), Properties => - GPR_File ("opengl.gpr") and - GPR_File ("opengl-glfw.gpr") and - GPR_File ("opengl-soil.gpr") and - GPR_File ("opengl-test.gpr") and + Project_File ("opengl.gpr") and + Project_File ("opengl-glfw.gpr") and + Project_File ("opengl-soil.gpr") and + Project_File ("opengl-test.gpr") and GPR_Scenario ("GLFW_Version", "2" or "3") and GPR_Scenario ("Mode", "debug" or "release") and @@ -43,6 +43,11 @@ 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 (System_Is (GNU_Linux), GPR_External ("Windowing_System", "x11")), diff --git a/index/alire-index-whitakers_words.ads b/index/alire-index-whitakers_words.ads index e5aab6d9..2ad0e3f9 100644 --- a/index/alire-index-whitakers_words.ads +++ b/index/alire-index-whitakers_words.ads @@ -10,23 +10,29 @@ package Alire.Index.Whitakers_Words is Prj_Maintainer : constant String := "Martin Keegan"; Prj_Website : constant URL := "http://mk270.github.io/whitakers-words/"; - V_0_0_0 : constant Release := - Register (Prj_Name, - V ("2017.09.10"), - Prj_Desc, - Git (Prj_Repo, "27be95b8a06d7b22c0600c824cf929ab43efcf25"), - Properties => - GPR_File ("words.gpr") and + V_2017_09_10 : constant Release := + Register (Prj_Name, + V ("2017.09.10"), + Prj_Desc, + Git (Prj_Repo, "27be95b8a06d7b22c0600c824cf929ab43efcf25"), + Properties => + Project_File ("words.gpr") and - Executable ("words") and + Executable ("words") and - Author (Prj_Author) and - Maintainer (Prj_Maintainer) and - Website (Prj_Website) and - License (Public_Domain) and + Author (Prj_Author) and + Maintainer (Prj_Maintainer) and + Website (Prj_Website) and + License (Public_Domain) and - Comment ("This package builds the binary but additional steps are needed") and - Comment ("See the README file for further instructions") - ); + 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 => + not Compiler_Is (GNAT_FSF_7_2) -- bug with SAL library not binding + ); end Alire.Index.Whitakers_Words; diff --git a/src/alire-releases.adb b/src/alire-releases.adb index 3a336494..58fdae20 100644 --- a/src/alire-releases.adb +++ b/src/alire-releases.adb @@ -70,6 +70,21 @@ package body Alire.Releases is end return; end GPR_Files; + ------------------- + -- Project_Files -- + ------------------- + + function Project_Files (R : Release; + P : Properties.Vector) + return Utils.String_Vector is + begin + return Files : Utils.String_Vector := Values (R.Properties.Evaluate (P), Project_File) do + if Files.Is_Empty then + Files.Append (R.Project & ".gpr"); + end if; + end return; + end Project_Files; + ------------------------ -- Labeled_Properties -- ------------------------ diff --git a/src/alire-releases.ads b/src/alire-releases.ads index 369ffad2..3776829a 100644 --- a/src/alire-releases.ads +++ b/src/alire-releases.ads @@ -53,8 +53,15 @@ package Alire.Releases with Preelaborate is function GPR_Files (R : Release; P : Properties.Vector) return Utils.String_Vector; - -- Explicitly declared ones, or if default one if none declared + -- 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_Files (R : Release; + P : Properties.Vector) + 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. function Image (R : Release) return Folder_String; -- Unique string built as name_version_id