Towards declared executables
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 --
|
||||
-----------
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user