Streamlined dependencies working, solver is greedy

This commit is contained in:
Alejandro R Mosteo
2018-05-07 00:14:04 +02:00
parent cf1da607e8
commit 73d2b8b435
9 changed files with 41 additions and 20 deletions
+24
View File
@@ -1,5 +1,29 @@
package body Alire.Containers is
------------
-- Insert --
------------
procedure Insert (Dst : in out Release_Map; Src : Release_Map) is
begin
for E of Src loop
Dst.Insert (E.Project, E);
end loop;
end Insert;
---------------
-- Inserting --
---------------
function Inserting (Dst : Release_Map; Src : Release_Map) return Release_Map is
begin
return Result : Release_Map := Dst do
for E of Src loop
Result.Insert (E.Project, E);
end loop;
end return;
end Inserting;
---------------
-- Excluding --
---------------
+10
View File
@@ -1,8 +1,10 @@
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
with Ada.Containers.Indefinite_Holders;
with Ada.Containers.Indefinite_Ordered_Maps;
with Ada.Containers.Indefinite_Ordered_Sets;
with Alire.Conditional;
with Alire.Dependencies;
with Alire.Milestones;
with Alire.Releases;
@@ -10,6 +12,10 @@ with Semantic_Versioning;
package Alire.Containers with Preelaborate is
package Dependency_Lists Is new Ada.Containers.Indefinite_Doubly_Linked_Lists
(Dependencies.Dependency,
Dependencies."=");
package Milestone_Sets is new Ada.Containers.Indefinite_Ordered_Sets (Milestones.Milestone,
Milestones."<",
Milestones."=");
@@ -43,6 +49,10 @@ package Alire.Containers with Preelaborate is
function Including (Map : Release_Map; Release : Releases.Release) return Release_Map;
-- Finds the current release (if existing) and replaces/adds the new Release
procedure Insert (Dst : in out Release_Map; Src : Release_Map);
function Inserting (Dst : Release_Map; Src : Release_Map) return Release_Map;
function To_Dependencies (Map : Release_Map)
return Conditional.Dependencies;
+3 -2
View File
@@ -3,7 +3,8 @@ private with Alire_Early_Elaboration; pragma Unreferenced (Alire_Early_Elaborati
with Alire.Actions;
with Alire.Conditional;
with Alire.Containers;
with Alire.Dependencies.Vectors;
with Alire.Dependencies;
-- with Alire.Dependencies.Vectors;
with Alire.GPR;
with Alire.Licensing;
with Alire.Origins;
@@ -235,7 +236,7 @@ package Alire.Index is
------------------
use all type Actions.Moments;
use all type Alire.Dependencies.Vectors.Vector;
-- use all type Alire.Dependencies.Vectors.Vector;
use all type GPR.Value;
use all type GPR.Value_Vector;
use all type Licensing.Licenses;
+2 -16
View File
@@ -1,4 +1,4 @@
with Alire.Platform;
-- with Alire.Platform;
with Alire.Platforms;
with Alire.Projects;
with Alire.Requisites.Booleans;
@@ -357,21 +357,7 @@ package body Alire.Releases is
-------------
function Version (R : Release) return Semantic_Versioning.Version is
begin
if R.Origin.Is_Native then
declare
Native_Version : constant String := Platform.Current.Package_Version (R.Origin);
begin
if Native_Version /= "" then
return New_Version (Image (R.Version) & "+" & Native_Version);
else
return R.Version;
end if;
end;
else
return R.Version;
end if;
end Version;
(R.Version);
--------------
-- Whenever --