GPR Paths + bunch'o libs
This commit is contained in:
+26
-3
@@ -47,20 +47,43 @@ package body Alire.Index is
|
||||
Version : Semantic_Versioning.Version;
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- Barrier
|
||||
XXXXXXXXXXXXXX : Utils.XXX_XXX := Utils.XXX_XXX_XXX;
|
||||
-- Optional
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Alr_Properties : Build_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
return Release
|
||||
is
|
||||
pragma Unreferenced (XXXXXXXXXXXXXX);
|
||||
use all type Alire.Properties.Labeled.Labels;
|
||||
begin
|
||||
-- Until the user/internal properties settle, we'll keep these checks off
|
||||
|
||||
-- for P of Properties.All_Values loop
|
||||
-- if P in Alire.Properties.Labeled.Label and then
|
||||
-- Alire.Properties.Labeled.Label (P).Name = GPR_Config
|
||||
-- then
|
||||
-- raise Program_Error with "alr property given as user property";
|
||||
-- end if;
|
||||
-- end loop;
|
||||
--
|
||||
-- for P of Alr_Properties.All_Values loop
|
||||
-- if P not in Alire.Properties.Labeled.Label and then
|
||||
-- Alire.Properties.Labeled.Label (P).Name /= GPR_Config
|
||||
-- then
|
||||
-- raise Program_Error with "user property given as alr property";
|
||||
-- end if;
|
||||
-- end loop;
|
||||
|
||||
return Rel : constant Alire.Releases.Release :=
|
||||
Alire.Releases.New_Release (Project,
|
||||
Description,
|
||||
Version,
|
||||
Origin,
|
||||
Dependencies,
|
||||
Properties => Properties,
|
||||
Properties => Alr_Properties and Properties,
|
||||
Available => Available_When)
|
||||
do
|
||||
if Catalog.Contains (Rel) then
|
||||
|
||||
+43
-24
@@ -16,35 +16,54 @@ with Alire.Requisites;
|
||||
with Alire.Requisites.Dependencies;
|
||||
with Alire.Requisites.Platform;
|
||||
with Alire.Root_Project;
|
||||
with Alire.Utils;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Index is
|
||||
|
||||
---------------
|
||||
-- CATALOG --
|
||||
---------------
|
||||
|
||||
Catalog : Containers.Release_Set;
|
||||
|
||||
-----------------
|
||||
-- Index types --
|
||||
-----------------
|
||||
|
||||
subtype Release_Dependencies is Conditional.Dependencies;
|
||||
subtype Release_Properties is Conditional.Properties;
|
||||
|
||||
subtype Release_Properties is Conditional.Properties;
|
||||
Subtype Build_Properties is Conditional.Properties;
|
||||
-- We separate properties of a release in two sets:
|
||||
-- Properties that are of interest to the user of a project,
|
||||
-- and properties that concern only the alr packaging.
|
||||
-- This is purely for reading clarity. Only GPR_Config at this time belongs to the latter set
|
||||
-- Unfortunately it would be too much a hassle to have separate types for those, so this is only
|
||||
-- checked at runtime. I'm not sure that this separation is really useful yet anyway.
|
||||
|
||||
No_Dependencies : constant Release_Dependencies := Conditional.For_Dependencies.Empty;
|
||||
No_Properties : constant Release_Properties := Conditional.For_Properties.Empty;
|
||||
No_Requisites : constant Requisites.Tree := Requisites.Trees.Empty_Tree;
|
||||
|
||||
|
||||
subtype Release is Alire.Releases.Release;
|
||||
|
||||
function Register (-- Mandatory
|
||||
Project : Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- Optional
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Project : Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- we force naming beyond this point with this ugly guard:
|
||||
XXXXXXXXXXXXXX : Utils.XXX_XXX := Utils.XXX_XXX_XXX;
|
||||
-- Optional
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Alr_Properties : Build_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
return Release;
|
||||
-- Properties are of the Release
|
||||
-- Requisites are properties that dependencies have to fulfill, not used yet.
|
||||
-- Available_On are properties the platform has to fulfill.
|
||||
-- Properties are generally interesting to the user
|
||||
-- Alr_Properties are only interesting to alr
|
||||
|
||||
subtype Platform_Independent_Path is String with Dynamic_Predicate =>
|
||||
(for all C of Platform_Independent_Path => C /= '\');
|
||||
@@ -184,9 +203,8 @@ package Alire.Index is
|
||||
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 (File : Platform_Independent_Path) return Release_Properties;
|
||||
function Maintainer is new PL.Cond_New_Label (Properties.Labeled.Maintainer);
|
||||
function Project_File is new PL.Cond_New_Label (Properties.Labeled.Project_File);
|
||||
function Website is new PL.Cond_New_Label (Properties.Labeled.Website);
|
||||
|
||||
function U (Prop : Properties.Vector) return Conditional.Properties
|
||||
@@ -204,15 +222,15 @@ package Alire.Index is
|
||||
|
||||
function "and" (L, R : Release_Properties) return Release_Properties
|
||||
renames Conditional.For_Properties."and";
|
||||
|
||||
-- function "and" (D1, D2 : Dependencies.Vector) return Dependencies.Vector renames Alire.Dependencies.Vectors."and";
|
||||
-- function "and" (P1, P2 : Properties.Vector) return Properties.Vector renames Alire.Properties."and";
|
||||
|
||||
-- function Verifies (P : Properties.Property'Class) return Properties.Vector;
|
||||
-- function "+" (P : Properties.Property'Class) return Properties.Vector renames Verifies;
|
||||
--
|
||||
-- function Requires (R : Requisites.Requisite'Class) return Requisites.Tree;
|
||||
-- function "+" (R : Requisites.Requisite'Class) return Requisites.Tree renames Requires;
|
||||
------------------------
|
||||
-- BUILD PROPERTIES --
|
||||
------------------------
|
||||
-- Those instruct alr on how to build, but are not the main concern of the project user
|
||||
|
||||
function GPR_Config is new PL.Cond_New_Label (Properties.Labeled.GPR_Config);
|
||||
function GPR_File (File : Platform_Independent_Path) return Release_Properties;
|
||||
function GPR_Path (Path : Platform_Independent_Path) return Release_Properties;
|
||||
|
||||
------------------
|
||||
-- REQUISITES --
|
||||
@@ -248,8 +266,9 @@ package Alire.Index is
|
||||
private
|
||||
|
||||
function GPR_File_Unsafe is new PL.Cond_New_Label (Properties.Labeled.GPR_File);
|
||||
function GPR_Path_Unsafe is new PL.Cond_New_Label (Properties.Labeled.GPR_Path);
|
||||
|
||||
function GPR_File (File : Platform_Independent_Path) return Release_Properties
|
||||
renames GPR_File_Unsafe;
|
||||
function GPR_File (File : Platform_Independent_Path) return Release_Properties renames GPR_File_Unsafe;
|
||||
function GPR_Path (Path : Platform_Independent_Path) return Release_Properties renames GPR_Path_Unsafe;
|
||||
|
||||
end Alire.Index;
|
||||
|
||||
@@ -6,14 +6,21 @@ package Alire.Properties.Labeled with Preelaborate is
|
||||
|
||||
-- Properties that have a single string value and a name
|
||||
|
||||
type Labels is (Author, -- VIP
|
||||
type Labels is (-- user labels
|
||||
Author, -- VIP
|
||||
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
|
||||
Project_File,-- GPR files that the user can use. No path. This is purely informative
|
||||
Website,
|
||||
|
||||
-- internal labels
|
||||
GPR_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)
|
||||
-- Those are used when testing the build, and must include full relative path
|
||||
GPR_Path -- Extra path to add to the environment to look for projects
|
||||
); -- A website other than the repository
|
||||
|
||||
type Label (<>) is new Properties.Property with private;
|
||||
|
||||
|
||||
@@ -40,10 +40,21 @@ package Alire.Utils with Preelaborate is
|
||||
function Flatten (V : String_Vector; Separator : String := " ") return String;
|
||||
-- Concatenate all elements
|
||||
|
||||
-----------------
|
||||
-- XXX_XXX_XXX --
|
||||
-----------------
|
||||
|
||||
type XXX_XXX (<>) is limited private;
|
||||
function XXX_XXX_XXX return XXX_XXX;
|
||||
|
||||
|
||||
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));
|
||||
|
||||
type XXX_XXX is limited null record;
|
||||
function XXX_XXX_XXX return XXX_XXX is (null record);
|
||||
|
||||
end Alire.Utils;
|
||||
|
||||
Reference in New Issue
Block a user