Eliminated dependency on alr on new projects

This commit is contained in:
A
2018-02-19 15:57:30 +01:00
parent ab74bb30df
commit 4a38ae3230
5 changed files with 50 additions and 21 deletions
+15
View File
@@ -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;
+1 -1
View File
@@ -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;
+2
View File
@@ -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;
+32
View File
@@ -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;
-20
View File
@@ -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)