diff --git a/index/alire-index-rxada.ads b/index/alire-index-rxada.ads index 7a8015fa..c3ae5891 100644 --- a/index/alire-index-rxada.ads +++ b/index/alire-index-rxada.ads @@ -11,6 +11,12 @@ package Alire.Index.RxAda is Desc, Hg (Repo, "361d4e2ab20a7dcca007e31bf7094d57b13fee6b"), Properties => + + Executable ("rx-examples-basic") and + Executable ("rx-examples-minimal") and + Executable ("rx-examples-tests") and + Executable ("rx-examples-threading") and + Maintainer ("alejandro@mosteo.com") and Website (Repo)); diff --git a/src/alire-index.ads b/src/alire-index.ads index e32eba1a..fe49a48c 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -84,6 +84,7 @@ package Alire.Index is -- Shortcuts for properties/requisites: -- "Typed" attributes (named pairs of label-value) + function Executable is new Properties.Labeled.Generic_New_Label (Properties.Labeled.Executable); function Maintainer is new Properties.Labeled.Generic_New_Label (Properties.Labeled.Maintainer); function Website is new Properties.Labeled.Generic_New_Label (Properties.Labeled.Website); diff --git a/src/alire-properties-labeled.ads b/src/alire-properties-labeled.ads index ee83ff69..7a8735f8 100644 --- a/src/alire-properties-labeled.ads +++ b/src/alire-properties-labeled.ads @@ -4,8 +4,9 @@ package Alire.Properties.Labeled with Preelaborate is -- Properties that have a single string value and a name - type Labels is (Maintainer, - Website); + type Labels is (Executable, -- A resulting executable built by the project + Maintainer, -- Info about the maintainer + Website); -- A website other than the repository type Label (<>) is new Properties.Property with private; diff --git a/src/alire-releases.adb b/src/alire-releases.adb index 1043c972..9636d3e7 100644 --- a/src/alire-releases.adb +++ b/src/alire-releases.adb @@ -1,7 +1,31 @@ +with Alire.Properties.Labeled; + with GNAT.IO; -- To keep preelaborable package body Alire.Releases is +----------------- +-- Executables -- +----------------- + + function Executables (R : Release) return Utils.String_Vector is + begin + return Exes : Utils.String_Vector do + for P of R.Props loop + if P in Properties.Labeled.Label'Class then + declare + use all type Properties.Labeled.Labels; + Label : Properties.Labeled.Label renames Properties.Labeled.Label (P); + begin + if Label.Name = Executable then + Exes.Append (Label.Value); + end if; + end; + end if; + end loop; + end return; + end Executables; + ----------- -- Print -- ----------- diff --git a/src/alire-releases.ads b/src/alire-releases.ads index 16ebe018..35da9fcf 100644 --- a/src/alire-releases.ads +++ b/src/alire-releases.ads @@ -1,9 +1,9 @@ - with Alire.Dependencies.Vectors; with Alire.Milestones; with Alire.Origins; with Alire.Properties; with Alire.Requisites; +with Alire.Utils; with Semantic_Versioning; @@ -31,6 +31,9 @@ package Alire.Releases with Preelaborate is function Origin (R : Release) return Origins.Origin; -- function Origin_Image (R : Release) return String; + function Executables (R : Release) return Utils.String_Vector; + -- Only explicity declared ones + function Image (R : Release) return String; -- Unique string built as name-version-id function Unique_Folder (R : Release) return String renames Image; diff --git a/src/alire-utils.ads b/src/alire-utils.ads index 6228dc5b..439cfda8 100644 --- a/src/alire-utils.ads +++ b/src/alire-utils.ads @@ -1,5 +1,10 @@ +with Ada.Containers.Indefinite_Vectors; + package Alire.Utils with Preelaborate is function To_Mixed_Case (S : String) return String; + package String_Vectors is new Ada.Containers.Indefinite_Vectors (Positive, String); + subtype String_Vector is String_Vectors.Vector; + end Alire.Utils;