diff --git a/index/alire-index-alr.ads b/index/alire-index-alr.ads new file mode 100644 index 00000000..7ef348d9 --- /dev/null +++ b/index/alire-index-alr.ads @@ -0,0 +1,15 @@ +package Alire.Index.Alr is + + Name : constant Project_Name := "alr"; + Repo : constant URL := "https://bitbucket.org/aleteolabs/alr.git"; + + Desc : constant Project_Description := "Command-line tool from the Alire project"; + + V_1_0_0 : constant Release := + Register_Git (Name, + V ("0.1.0"), + Desc, + Repo, + "ce78e7706c9d3f97605df48d8befca5407f8d328"); + +end Alire.Index.Alr; diff --git a/src/alire-index.ads b/src/alire-index.ads index 4898ffcd..67ab1720 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -20,7 +20,7 @@ package Alire.Index is subtype Dependencies is Alire.Dependencies.Vectors.Vector; No_Dependencies : constant Dependencies := Alire.Dependencies.Vectors.No_Dependencies; - No_Properties : constant Properties.Vector := Properties.Vectors.Empty_Vector; + No_Properties : constant Properties.Vector := Properties.No_Properties; No_Requisites : constant Requisites.Tree := Requisites.Trees.Empty_Tree; subtype Release is Alire.Releases.Release; diff --git a/src/alire-properties.ads b/src/alire-properties.ads index 8649f6e0..69f2f66c 100644 --- a/src/alire-properties.ads +++ b/src/alire-properties.ads @@ -15,6 +15,8 @@ package Alire.Properties with Preelaborate is subtype Vector is Vectors.Vector; + No_Properties : Vector renames Vectors.Empty_Vector; + function "and" (L, R : Property'Class) return Vector; function "and" (L : Vector; R : Property'Class) return Vector; diff --git a/src/alire-root_project.adb b/src/alire-root_project.adb new file mode 100644 index 00000000..f14f3648 --- /dev/null +++ b/src/alire-root_project.adb @@ -0,0 +1,32 @@ +with Alire.Properties; +with Alire.Requisites; +with Alire.Repositories.Local; + +package body Alire.Root_Project is + + ---------------------- + -- Set_Root_Project -- + ---------------------- + + function Set (Project : Project_Name; + Version : Semantic_Versioning.Version; + Depends_On : Dependencies.Vectors.Vector := Dependencies.Vectors.No_Dependencies) + return Releases.Release + is + Rel : constant Releases.Release := + Alire.Releases.New_Release (Project, + "working copy of " & Project, -- FIXME might be too long + Version, + Alire.Repositories.Local.Repo, + "filesystem", + Depends_On, + Properties => Properties.No_Properties, + Requisites => Requisites.No_Requisites, + Native => False); + begin + Root_Project.Current.Replace_Element (Rel); + + return Rel; + end Set; + +end Alire.Root_Project; diff --git a/src/alire-root_project.ads b/src/alire-root_project.ads index 939cc557..f78142d7 100644 --- a/src/alire-root_project.ads +++ b/src/alire-root_project.ads @@ -1,6 +1,5 @@ with Alire.Containers; with Alire.Dependencies.Vectors; -with Alire.Os_Lib; with Alire.Releases; with Semantic_Versioning; @@ -16,25 +15,6 @@ package Alire.Root_Project is -- unless the hash already matches. In this case, we know the project file is -- missing the Set_Root_Project call - procedure Ensure_Valid - with Post => (not Current.Is_Empty or else raise Program_Error with "No root project when expected to exist"); - -- Graceful check that Current contains what it should. - - function Name return String - with Pre => (not Current.Is_Empty); - - function GPR_File (Prj : Alire.Project_Name := Current.Element.Project) return String - with Pre => (not Current.Is_Empty); - -- The actual project root file (not the _alrbuild one!) - - function GPR_Alr_File (Prj : Alire.Project_Name := Current.Element.Project) return String - with Pre => (not Current.Is_Empty); - -- The alr environment project file (project_alr.gpr) - - function Enter_Root (Prj : Alire.Project_Name := Current.Element.Project) return Alire.OS_Lib.Folder_Guard - with Pre => (not Current.Is_Empty); - -- Enters the root folder if not already there - function Set (Project : Project_Name; Version : Semantic_Versioning.Version; Depends_On : Dependencies.Vectors.Vector := Dependencies.Vectors.No_Dependencies)