Build config to apply by alr
This commit is contained in:
@@ -33,9 +33,14 @@ package Alire.Index.Alire is
|
||||
At_Least ("star_citizen", V ("3.0")), -- Wish...
|
||||
When_False => At_Least ("windows_100", V ("1.0"))),
|
||||
|
||||
Properties =>
|
||||
Properties =>
|
||||
GPR_Extra_Config ("-XProfile=False") and
|
||||
-- Sample extra params for build
|
||||
|
||||
GPR_Scenario ("Build", "Debug" or "Release") and
|
||||
GPR_Free_Scenario ("Path_To_Something") and
|
||||
-- Known scenario variables
|
||||
|
||||
If_Platform
|
||||
(System_Is (Windows),
|
||||
GPR_File ("project_win.gpr")) and
|
||||
@@ -43,18 +48,27 @@ package Alire.Index.Alire is
|
||||
(System_Is (GNU_Linux),
|
||||
If_Platform (Distribution_Is (Ubuntu), -- Nested conditions
|
||||
GPR_File ("project_ubuntu.gpr"))) and
|
||||
-- Conditional project file
|
||||
|
||||
If_Platform
|
||||
(System_Is (GNU_Linux),
|
||||
Comment ("Long life the penguin")) and
|
||||
-- Conditions on operating system
|
||||
|
||||
If_Platform
|
||||
(not Compiler_Is (GNAT_Unknown),
|
||||
Comment ("Never saw that compiler") and Comment ("But I would like to")) and
|
||||
-- Conditions on compiler version
|
||||
|
||||
If_Platform
|
||||
(Version_Is (Ubuntu_Artful),
|
||||
When_True => Comment ("Living on the edge"),
|
||||
When_False => Comment ("I am a rock")) and
|
||||
-- Conditions on distribution release
|
||||
|
||||
Comment ("Tell me about your mother") and
|
||||
Website ("http://www.www.www"),
|
||||
-- Unconditional properties
|
||||
|
||||
Available_When => -- Impossible mix
|
||||
(System_Is (Windows) and System_Is (GNU_Linux)) or
|
||||
|
||||
@@ -11,13 +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
|
||||
|
||||
License (LGPL_3_0) and
|
||||
Maintainer ("alejandro@mosteo.com"));
|
||||
Author ("alejandro@mosteo.com") and
|
||||
License (LGPL_3_0));
|
||||
|
||||
end Alire.Index.RxAda;
|
||||
|
||||
+7
-6
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 --
|
||||
-----------------------
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user