Build config to apply by alr

This commit is contained in:
Alejandro R. Mosteo
2018-03-03 13:52:26 +01:00
parent dfb3191b3a
commit 68892cbaf2
9 changed files with 84 additions and 17 deletions
+7 -6
View File
@@ -156,12 +156,13 @@ package Alire.Index is
-- Conditional vectors (although with unconditional value inside)
package PL renames Properties.Labeled;
function Author is new PL.Cond_New_Label (Properties.Labeled.Author);
function Comment is new PL.Cond_New_Label (Properties.Labeled.Comment);
function Executable is new PL.Cond_New_Label (Properties.Labeled.Executable);
function GPR_File is new PL.Cond_New_Label (Properties.Labeled.GPR_File);
function Maintainer is new PL.Cond_New_Label (Properties.Labeled.Maintainer);
function Website is new PL.Cond_New_Label (Properties.Labeled.Website);
function Author is new PL.Cond_New_Label (Properties.Labeled.Author);
function Comment is new PL.Cond_New_Label (Properties.Labeled.Comment);
function Executable is new PL.Cond_New_Label (Properties.Labeled.Executable);
function GPR_Extra_Config is new PL.Cond_New_Label (Properties.Labeled.GPR_Extra_Config);
function GPR_File is new PL.Cond_New_Label (Properties.Labeled.GPR_File);
function Maintainer is new PL.Cond_New_Label (Properties.Labeled.Maintainer);
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;
+1
View File
@@ -10,6 +10,7 @@ package Alire.Properties.Labeled with Preelaborate is
Comment, -- Extra text
Description, -- One-liner description, so it is searched too
Executable, -- A resulting executable built by the project
GPR_Extra_Config, -- Extra config to pass to gprbuild for building the project with alr
GPR_File, -- Alternative naming of the project file (or more than one)
Maintainer, -- Info about the maintainer of the alr-packaged project
Website); -- A website other than the repository
+13
View File
@@ -60,6 +60,19 @@ package body Alire.Releases is
end return;
end GPR_Files;
------------------------
-- Labeled_Properties --
------------------------
function Labeled_Properties (R : Release;
P : Properties.Vector;
Label : Properties.Labeled.Labels)
return Utils.String_Vector
is
begin
return Values (R.Properties.Evaluate (P), Label);
end Labeled_Properties;
-----------------------
-- Print_Conditional --
-----------------------
+7 -3
View File
@@ -4,13 +4,13 @@ with Alire.Dependencies.Vectors;
with Alire.Milestones;
with Alire.Origins;
with Alire.Properties;
with Alire.Properties.Labeled;
with Alire.Requisites;
with Alire.Utils;
with Semantic_Versioning;
private with Alire.OS_Lib;
private with Alire.Properties.Labeled;
package Alire.Releases with Preelaborate is
@@ -60,17 +60,21 @@ package Alire.Releases with Preelaborate is
-- Unique string built as name_version_id
function Unique_Folder (R : Release) return Path_String renames Image;
function Labeled_Properties (R : Release; P : Properties.Vector; Label : Properties.Labeled.Labels)
return Utils.String_Vector;
-- Get all values for a given property for a given platform properties
function Milestone (R : Release) return Milestones.Milestone;
procedure Print (R : Release);
-- Dump info to console
-- Dump info to console
-- Search helpers
function Property_Contains (R : Release; Str : String) return Boolean;
-- True if some property contains the given string
-- Dependency generation helpers
-- Dependency generation helpers for all semantic versioning functions:
function On (Name : Project_Name;
Versions : Semantic_Versioning.Version_Set)
+1 -1
View File
@@ -3,7 +3,7 @@ with Alire.Dependencies.Vectors;
package Alire.Types with Preelaborate is
-- Recopilation of types for convenient use in alr
-- Recopilation of types for convenient use and documentation
subtype Platform_Dependencies is Dependencies.Vectors.Vector;
-- A plain vector
+15
View File
@@ -26,6 +26,21 @@ package body Alire.Utils is
return Str;
end Head;
-------------
-- Flatten --
-------------
function Flatten (V : String_Vector; Separator : String := " ") return String is
function Flatten (Pos : Positive; V : String_Vector) return String is
(if Pos > V.Count
then ""
else V (Pos) & Separator & Flatten (Pos + 1, V));
begin
return Flatten (1, V);
end Flatten;
----------
-- Tail --
----------
+23 -3
View File
@@ -7,9 +7,6 @@ package Alire.Utils with Preelaborate is
function Contains (Text : String; Sub : String) return Boolean;
package String_Vectors is new Ada.Containers.Indefinite_Vectors (Positive, String);
subtype String_Vector is String_Vectors.Vector;
function Head (Str : String; Separator : Character) return String;
-- if Str contains Separator, the lhs is returned
-- Otherwise Str is returned
@@ -18,4 +15,27 @@ package Alire.Utils with Preelaborate is
-- If Str contains Separator, the rhs is returned
-- Otherwise ""
--------------------
-- String_Vectors --
--------------------
-- To simplify somewhat managing lists of strigns
package String_Vectors is new Ada.Containers.Indefinite_Vectors (Positive, String);
type String_Vector is new String_Vectors.Vector with null record;
Empty_Vector : constant String_Vector;
function Count (V : String_Vector) return Natural;
-- FSM do I hate the Containers.Count_Type...
function Flatten (V : String_Vector; Separator : String := " ") return String;
-- Concatenate all elements
private
Empty_Vector : constant String_Vector := (String_Vectors.Empty_Vector with null record);
function Count (V : String_Vector) return Natural is (Natural (String_Vectors.Vector (V).Length));
end Alire.Utils;