Half-way through typed names
This commit is contained in:
@@ -7,7 +7,7 @@ package body Alire.Containers is
|
||||
function To_Map (R : Releases.Release) return Release_Map is
|
||||
begin
|
||||
return M : Release_Map do
|
||||
M.Include (R.Project, R);
|
||||
M.Include (R.Name, R);
|
||||
end return;
|
||||
end To_Map;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ with Ada.Containers.Indefinite_Ordered_Maps;
|
||||
with Ada.Containers.Indefinite_Ordered_Sets;
|
||||
|
||||
with Alire.Milestones;
|
||||
with Alire.Projects;
|
||||
with Alire.Releases;
|
||||
|
||||
with Semantic_Versioning;
|
||||
@@ -25,12 +26,12 @@ package Alire.Containers with Preelaborate is
|
||||
|
||||
|
||||
package Project_Version_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||
(Project_Name, Semantic_Versioning.Version, "<", Semantic_Versioning."<");
|
||||
(Name_String, Semantic_Versioning.Version, "<", Semantic_Versioning."<");
|
||||
subtype Version_Map is Project_Version_Maps.Map;
|
||||
|
||||
|
||||
package Project_Release_Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||
(Project_Name, Releases.Release, "<", Releases."=");
|
||||
(Projects.Names, Releases.Release, Projects."<", Releases."=");
|
||||
subtype Release_Map is Project_Release_Maps.Map;
|
||||
|
||||
function To_Map (R : Releases.Release) return Release_Map;
|
||||
|
||||
@@ -17,7 +17,7 @@ package Alire.Dependencies.Vectors with Preelaborate is
|
||||
|
||||
-- Creation of dependency vectors
|
||||
|
||||
function New_Dependency (Name : Project_Name;
|
||||
function New_Dependency (Name : Names;
|
||||
Versions : Semantic_Versioning.Version_Set) return Vector;
|
||||
|
||||
function "and" (Dep1, Dep2 : Vector) return Vector is (Dep1 & Dep2);
|
||||
@@ -33,9 +33,9 @@ private
|
||||
-- New_Dependency --
|
||||
--------------------
|
||||
|
||||
function New_Dependency (Name : Project_Name;
|
||||
function New_Dependency (Name : Names;
|
||||
Versions : Semantic_Versioning.Version_Set) return Vector is
|
||||
(To_Vector ((Name'Length, Name, To_Holder (Versions)), 1));
|
||||
(To_Vector ((Name, To_Holder (Versions)), 1));
|
||||
|
||||
--------------------
|
||||
-- Image_One_Line --
|
||||
|
||||
@@ -2,18 +2,23 @@ private with Ada.Containers.Indefinite_Holders;
|
||||
|
||||
limited with Alire.Dependencies.Vectors;
|
||||
|
||||
with Alire.Projects;
|
||||
with Alire.Utils;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Dependencies with Preelaborate is
|
||||
|
||||
subtype Names is Projects.Names;
|
||||
|
||||
-- A single dependency is a project name plus a version set
|
||||
|
||||
type Dependency (<>) is tagged private;
|
||||
|
||||
function New_Dependency (Name : Project_Name;
|
||||
function New_Dependency (Name : Names;
|
||||
Versions : Semantic_Versioning.Version_Set) return Dependency;
|
||||
|
||||
function Project (Dep : Dependency) return Project_Name;
|
||||
function Project (Dep : Dependency) return Names;
|
||||
|
||||
function Versions (Dep : Dependency) return Semantic_Versioning.Version_Set;
|
||||
|
||||
@@ -31,21 +36,22 @@ private
|
||||
|
||||
type Version_Set_Holder is new Version_Holders.Holder with null record;
|
||||
|
||||
type Dependency (Name_Len : Positive) is tagged record
|
||||
Project : Project_Name (1 .. Name_Len);
|
||||
type Dependency is tagged record
|
||||
Project : Projects.Names;
|
||||
Versions_H : Version_Set_holder;
|
||||
end record;
|
||||
|
||||
function New_Dependency (Name : Project_Name;
|
||||
function New_Dependency (Name : Names;
|
||||
Versions : Semantic_Versioning.Version_Set) return Dependency
|
||||
is ((Name'Length, Name, To_Holder (Versions)));
|
||||
is ((Name, To_Holder (Versions)));
|
||||
|
||||
function Project (Dep : Dependency) return Project_Name is (Dep.Project);
|
||||
function Project (Dep : Dependency) return Names is (Dep.Project);
|
||||
|
||||
function Versions (Dep : Dependency) return Semantic_Versioning.Version_Set is
|
||||
(Dep.Versions_H.Element);
|
||||
|
||||
function Image (Dep : Dependency) return String is
|
||||
(Dep.Project & " is " & Semantic_Versioning.Image (Dep.Versions_H.Element));
|
||||
(Utils.To_Lower_Case (Dep.Project'Img) & " is " &
|
||||
Semantic_Versioning.Image (Dep.Versions_H.Element));
|
||||
|
||||
end Alire.Dependencies;
|
||||
|
||||
+31
-13
@@ -9,7 +9,19 @@ package body Alire.Index is
|
||||
-- Exists --
|
||||
------------
|
||||
|
||||
function Exists (Project : Project_Name;
|
||||
function Exists (Project : Name_String) return Boolean is
|
||||
begin
|
||||
return Names'Value (Project) = Alire_Reserved or else True;
|
||||
exception
|
||||
when others =>
|
||||
return False;
|
||||
end Exists;
|
||||
|
||||
------------
|
||||
-- Exists --
|
||||
------------
|
||||
|
||||
function Exists (Project : Name_String;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Boolean is
|
||||
begin
|
||||
@@ -26,7 +38,7 @@ package body Alire.Index is
|
||||
-- Find --
|
||||
----------
|
||||
|
||||
function Find (Project : Project_Name;
|
||||
function Find (Project : Name_String;
|
||||
Version : Semantic_Versioning.Version) return Release is
|
||||
begin
|
||||
for R of Catalog loop
|
||||
@@ -43,17 +55,17 @@ package body Alire.Index is
|
||||
--------------
|
||||
|
||||
function Register (-- Mandatory
|
||||
Project : Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Description : Project_Description;
|
||||
Origin : Origins.Origin;
|
||||
-- Barrier
|
||||
XXXXXXXXXXXXXX : Utils.XXX_XXX := Utils.XXX_XXX_XXX;
|
||||
Project : Names;
|
||||
Version : Semantic_Versioning.Version;
|
||||
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;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Alire.Requisites.Tree := No_Requisites)
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
Available_When : Release_Requisites := No_Requisites)
|
||||
return Release
|
||||
is
|
||||
pragma Unreferenced (XXXXXXXXXXXXXX);
|
||||
@@ -61,9 +73,9 @@ package body Alire.Index is
|
||||
begin
|
||||
return Rel : constant Alire.Releases.Release :=
|
||||
Alire.Releases.New_Release (Project,
|
||||
Description,
|
||||
Version,
|
||||
Origin,
|
||||
Notes,
|
||||
Dependencies,
|
||||
Properties => Properties,
|
||||
Private_Properties => Private_Properties,
|
||||
@@ -97,4 +109,10 @@ package body Alire.Index is
|
||||
return Path;
|
||||
end To_Native;
|
||||
|
||||
-----------
|
||||
-- Value --
|
||||
-----------
|
||||
|
||||
function Value (Project : Name_String) return Names is (Names'Value (Project));
|
||||
|
||||
end Alire.Index;
|
||||
|
||||
+15
-8
@@ -7,6 +7,7 @@ with Alire.GPR;
|
||||
with Alire.Licensing;
|
||||
with Alire.Origins;
|
||||
with Alire.Platforms;
|
||||
with Alire.Projects;
|
||||
with Alire.Properties;
|
||||
with Alire.Properties.Labeled;
|
||||
with Alire.Properties.Licenses;
|
||||
@@ -32,6 +33,7 @@ package Alire.Index is
|
||||
-- Index types --
|
||||
-----------------
|
||||
|
||||
subtype Names is Projects.Names;
|
||||
subtype Release_Dependencies is Conditional.Dependencies;
|
||||
subtype Release_Properties is Conditional.Properties;
|
||||
subtype Release_Requisites is Requisites.Tree;
|
||||
@@ -43,13 +45,13 @@ package Alire.Index is
|
||||
subtype Release is Alire.Releases.Release;
|
||||
|
||||
function Register (-- Mandatory
|
||||
Project : Project_Name;
|
||||
Project : Names;
|
||||
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
|
||||
Notes : Description_String := "";
|
||||
Dependencies : Release_Dependencies := No_Dependencies;
|
||||
Properties : Release_Properties := No_Properties;
|
||||
Private_Properties : Release_Properties := No_Properties;
|
||||
@@ -69,17 +71,22 @@ package Alire.Index is
|
||||
-- BASIC QUERIES --
|
||||
---------------------
|
||||
|
||||
function Exists (Project : Name_String) return Boolean;
|
||||
|
||||
function Exists (Project : Project_Name;
|
||||
function Exists (Project : Name_String;
|
||||
Version : Semantic_Versioning.Version)
|
||||
return Boolean;
|
||||
|
||||
function Find (Project : Project_Name;
|
||||
function Find (Project : Name_String;
|
||||
Version : Semantic_Versioning.Version) return Release;
|
||||
|
||||
function Value (Project : Name_String) return Names;
|
||||
|
||||
------------------------
|
||||
-- INDEXING SUPPORT --
|
||||
------------------------
|
||||
|
||||
use all type Projects.Names;
|
||||
|
||||
-- Shortcuts for origins:
|
||||
|
||||
@@ -103,7 +110,7 @@ package Alire.Index is
|
||||
function V (Semantic_Version : String) return Semver.Version
|
||||
renames Semver.Relaxed;
|
||||
|
||||
function On (Name : Project_Name;
|
||||
function On (Name : Names;
|
||||
Versions : Semver.Version_Set)
|
||||
return Conditional.Dependencies renames Releases.On;
|
||||
|
||||
@@ -118,7 +125,7 @@ package Alire.Index is
|
||||
-- A never available release
|
||||
|
||||
function Current (R : Release) return Release_Dependencies is
|
||||
(On (R.Project, Semver.Within_Major (R.Version)));
|
||||
(On (R.Name, Semver.Within_Major (R.Version)));
|
||||
-- Within the major of R,
|
||||
-- it will accept the newest/oldest version according to the resolution policy (by default, newest)
|
||||
|
||||
@@ -135,7 +142,7 @@ package Alire.Index is
|
||||
subtype Version is Semantic_Versioning.Version;
|
||||
subtype Version_Set is Semantic_Versioning.Version_Set;
|
||||
|
||||
function Current (P : Project_Name) return Release_Dependencies is (On (P, Semver.Any));
|
||||
function Current (P : Names) return Release_Dependencies is (On (P, Semver.Any));
|
||||
|
||||
-- These take a project name and a semantic version (see V above)
|
||||
function Within_Major is new Releases.From_Names (Semver.Within_Major);
|
||||
@@ -249,7 +256,7 @@ package Alire.Index is
|
||||
function Word_Size is new Requisites.Platform.Word_Sizes.Factory;
|
||||
use all type Requisites.Platform.Word_Sizes.Comparable;
|
||||
|
||||
function Set_Root_Release (Project : Alire.Project_Name;
|
||||
function Set_Root_Release (Project : Alire.Name_String;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Dependencies : Conditional.Dependencies := No_Dependencies)
|
||||
return Release renames Root_Release.Set;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
with Alire.Projects;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Milestones with Preelaborate is
|
||||
@@ -6,10 +8,10 @@ package Alire.Milestones with Preelaborate is
|
||||
|
||||
function "<" (L, R : Milestone) return Boolean;
|
||||
|
||||
function New_Milestone (Name : Project_Name;
|
||||
function New_Milestone (Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version) return Milestone;
|
||||
|
||||
function Project (M : Milestone) return Project_Name;
|
||||
function Project (M : Milestone) return Name_String;
|
||||
|
||||
function Version (M : Milestone) return Semantic_Versioning.Version;
|
||||
|
||||
@@ -17,8 +19,10 @@ package Alire.Milestones with Preelaborate is
|
||||
|
||||
private
|
||||
|
||||
type Milestone (Name_Len : Positive) is tagged record
|
||||
Name : Project_Name (1 .. Name_Len);
|
||||
use all type Projects.Names;
|
||||
|
||||
type Milestone is tagged record
|
||||
Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version;
|
||||
end record;
|
||||
|
||||
@@ -27,11 +31,11 @@ private
|
||||
function "<" (L, R : Milestone) return Boolean is
|
||||
(L.Name < R.Name or else (L.Name = R.Name and then L.Version < R.Version));
|
||||
|
||||
function New_Milestone (Name : Project_Name;
|
||||
function New_Milestone (Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version) return Milestone is
|
||||
(Name'Length, Name, Version);
|
||||
(Name, Version);
|
||||
|
||||
function Project (M : Milestone) return Project_Name is (M.Name);
|
||||
function Project (M : Milestone) return Name_String is (Projects.Image (M.Name));
|
||||
|
||||
function Version (M : Milestone) return Semantic_Versioning.Version is (M.Version);
|
||||
|
||||
|
||||
@@ -166,6 +166,10 @@ package body Alire.Releases is
|
||||
-- MILESTONE
|
||||
Put_Line (R.Milestone.Image & ": " & R.Description);
|
||||
|
||||
if R.Notes /= "" then
|
||||
Put_Line ("Notes: " & R.Notes);
|
||||
end if;
|
||||
|
||||
-- ORIGIN
|
||||
if R.Origin.Is_Native then
|
||||
Put_Line ("Origin (native package):");
|
||||
@@ -242,12 +246,12 @@ package body Alire.Releases is
|
||||
|
||||
function Whenever (R : Release; P : Properties.Vector) return Release is
|
||||
begin
|
||||
return Solid : constant Release (R.Name_Len, R.Descr_Len) :=
|
||||
(R.Name_Len, R.Descr_Len,
|
||||
return Solid : constant Release (R.Descr_Len) :=
|
||||
(R.Descr_Len,
|
||||
R.Name,
|
||||
R.Description,
|
||||
R.Version,
|
||||
R.Origin,
|
||||
R.Notes,
|
||||
R.Dependencies.Evaluate (P),
|
||||
R.Properties.Evaluate (P),
|
||||
R.Priv_Props.Evaluate (P),
|
||||
|
||||
+37
-23
@@ -3,6 +3,7 @@ with Alire.Dependencies;
|
||||
with Alire.Dependencies.Vectors;
|
||||
with Alire.Milestones;
|
||||
with Alire.Origins;
|
||||
with Alire.Projects;
|
||||
with Alire.Properties;
|
||||
with Alire.Properties.Labeled;
|
||||
with Alire.Requisites;
|
||||
@@ -16,10 +17,10 @@ package Alire.Releases with Preelaborate is
|
||||
|
||||
type Release (<>) is tagged private;
|
||||
|
||||
function New_Release (Name : Project_Name;
|
||||
Description : Project_Description;
|
||||
function New_Release (Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Private_Properties : Conditional.Properties;
|
||||
@@ -31,10 +32,14 @@ package Alire.Releases with Preelaborate is
|
||||
-- Materialize conditions in a Release once the whatever properties are known
|
||||
-- At present dependencies and properties
|
||||
|
||||
function Project (R : Release) return Project_Name;
|
||||
function Description (R : Release) return Project_Description;
|
||||
function Name (R : Release) return Projects.Names;
|
||||
function Project (R : Release) return Name_String;
|
||||
function Notes (R : Release) return Description_String; -- Specific to release
|
||||
function Version (R : Release) return Semantic_Versioning.Version;
|
||||
|
||||
function Description (R : Release) return Description_String;
|
||||
-- The global project description
|
||||
|
||||
function Depends (R : Release;
|
||||
P : Properties.Vector)
|
||||
return Dependencies.Vector;
|
||||
@@ -91,7 +96,7 @@ package Alire.Releases with Preelaborate is
|
||||
-- Dependency generation helpers for all semantic versioning functions:
|
||||
-- These are here to avoid a 'body not seen' Program_Error if they were in Index
|
||||
|
||||
function On (Name : Project_Name;
|
||||
function On (Name : Projects.Names;
|
||||
Versions : Semantic_Versioning.Version_Set)
|
||||
return Conditional.Dependencies;
|
||||
|
||||
@@ -101,7 +106,7 @@ package Alire.Releases with Preelaborate is
|
||||
|
||||
generic
|
||||
with function Condition (V : Semantic_Versioning.Version) return Semantic_Versioning.Version_Set;
|
||||
function From_Names (P : Project_Name;
|
||||
function From_Names (P : Projects.Names;
|
||||
V : Semantic_Versioning.Version) return Conditional.Dependencies;
|
||||
|
||||
function Unavailable return Conditional.Dependencies;
|
||||
@@ -109,19 +114,22 @@ package Alire.Releases with Preelaborate is
|
||||
|
||||
private
|
||||
|
||||
use all type Projects.Names;
|
||||
|
||||
function All_Properties (R : Release) return Conditional.Properties;
|
||||
|
||||
function Unavailable return Conditional.Dependencies is
|
||||
(On ("alire_unavailable", Semantic_Versioning.Any));
|
||||
(On (Alire_Reserved, Semantic_Versioning.Any));
|
||||
|
||||
use Alire.Properties;
|
||||
function Comment is new Alire.Properties.Labeled.Cond_New_Label (Alire.Properties.Labeled.Comment);
|
||||
function Describe is new Alire.Properties.Labeled.Cond_New_Label (Alire.Properties.Labeled.Description);
|
||||
|
||||
type Release (Name_Len, Descr_Len : Natural) is tagged record
|
||||
Name : Project_Name (1 .. Name_Len);
|
||||
Description : Project_Description (1 .. Descr_Len);
|
||||
type Release (Descr_Len : Natural) is tagged record
|
||||
Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String (1 .. Descr_Len);
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Priv_Props : Conditional.Properties;
|
||||
@@ -130,21 +138,25 @@ private
|
||||
|
||||
use all type Conditional.Properties;
|
||||
|
||||
function New_Release (Name : Project_Name;
|
||||
Description : Project_Description;
|
||||
function New_Release (Name : Projects.Names;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Origin : Origins.Origin;
|
||||
Notes : Description_String;
|
||||
Dependencies : Conditional.Dependencies;
|
||||
Properties : Conditional.Properties;
|
||||
Private_Properties : Conditional.Properties;
|
||||
Available : Alire.Requisites.Tree) return Release is
|
||||
(Name'Length, Description'Length,
|
||||
(Notes'Length,
|
||||
Name,
|
||||
Description,
|
||||
Version,
|
||||
Version,
|
||||
Origin,
|
||||
Notes,
|
||||
Dependencies,
|
||||
Describe (Description) and Properties,
|
||||
Describe (Projects.Description (Name)) and
|
||||
(if Notes /= ""
|
||||
then Comment (notes)
|
||||
else Conditional.For_Properties.Empty) and
|
||||
Properties,
|
||||
Private_Properties,
|
||||
Available);
|
||||
|
||||
@@ -158,8 +170,10 @@ private
|
||||
L.Version = R.Version and then
|
||||
Build (L.Version) < Build (R.Version)));
|
||||
|
||||
function Project (R : Release) return Project_Name is (R.Name);
|
||||
function Description (R : Release) return Project_Description is (R.Description);
|
||||
function Name (R : Release) return Projects.Names is (R.Name);
|
||||
function Project (R : Release) return Name_String is (Projects.Image (R.Name));
|
||||
function Description (R : Release) return Description_String is (Projects.Description (R.Name));
|
||||
function Notes (R : Release) return Description_String is (R.Notes);
|
||||
function Version (R : Release) return Semantic_Versioning.Version is (R.Version);
|
||||
|
||||
function Depends (R : Release;
|
||||
@@ -173,11 +187,11 @@ private
|
||||
(Milestones.New_Milestone (R.Name, R.Version));
|
||||
|
||||
function Default_Executable (R : Release) return String is
|
||||
(R.Name & OS_Lib.Exe_Suffix);
|
||||
(R.Project & OS_Lib.Exe_Suffix);
|
||||
|
||||
use all type Origins.Kinds;
|
||||
function Image (R : Release) return Folder_String is
|
||||
(R.Name & "_" &
|
||||
(R.Project & "_" &
|
||||
Image (R.Version) & "_" &
|
||||
(case R.Origin.Kind is
|
||||
when Filesystem => "filesystem",
|
||||
@@ -188,16 +202,16 @@ private
|
||||
|
||||
-- Dependency helpers
|
||||
|
||||
function On (Name : Project_Name;
|
||||
function On (Name : Projects.Names;
|
||||
Versions : Semantic_Versioning.Version_Set)
|
||||
return Conditional.Dependencies is
|
||||
(Conditional.For_Dependencies.New_Value -- A conditional (without condition) dependency vector
|
||||
(Dependencies.Vectors.New_Dependency (Name, Versions))); -- A dependency vector
|
||||
|
||||
function From_Release (R : Release) return Conditional.Dependencies is
|
||||
(On (R.Project, Condition (R.Version)));
|
||||
(On (R.Name, Condition (R.Version)));
|
||||
|
||||
function From_Names (P : Project_Name;
|
||||
function From_Names (P : Projects.Names;
|
||||
V : Semantic_Versioning.Version) return Conditional.Dependencies is
|
||||
(On (P, Condition (V)));
|
||||
|
||||
|
||||
+11
-11
@@ -4,6 +4,7 @@ with Ada.Directories;
|
||||
with Alire.Containers;
|
||||
with Alire.Index;
|
||||
with Alire.Origins;
|
||||
with Alire.Projects;
|
||||
with Alire.Requisites;
|
||||
|
||||
package body Alire.Root_Release is
|
||||
@@ -30,24 +31,23 @@ package body Alire.Root_Release is
|
||||
-- Set --
|
||||
---------
|
||||
|
||||
function Set (Project : Alire.Project_Name;
|
||||
function Set (Project : Alire.Name_String;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
return Releases.Release
|
||||
is
|
||||
use Origins;
|
||||
|
||||
Descr : constant String := "working copy of " & Project;
|
||||
Rel : constant Releases.Release :=
|
||||
Alire.Releases.New_Release (Project,
|
||||
Descr (Descr'First .. Descr'First - 1 +
|
||||
Natural'Min (Descr'Length, Max_Description_Length)),
|
||||
Version,
|
||||
New_Filesystem (Ada.Directories.Current_Directory),
|
||||
Dependencies,
|
||||
Properties => Index.No_Properties,
|
||||
Private_Properties => Index.No_Properties,
|
||||
Available => Requisites.No_Requisites);
|
||||
Alire.Releases.New_Release
|
||||
(Projects.Alire_Reserved,
|
||||
Version => Version,
|
||||
Origin => New_Filesystem (Ada.Directories.Current_Directory),
|
||||
Notes => "Unindexed working copy",
|
||||
Dependencies => Dependencies,
|
||||
Properties => Index.No_Properties,
|
||||
Private_Properties => Index.No_Properties,
|
||||
Available => Requisites.No_Requisites);
|
||||
begin
|
||||
if Index.Exists (Project, Version) then
|
||||
-- This is done to ensure that properties are all available
|
||||
|
||||
@@ -7,8 +7,8 @@ package Alire.Root_Release is
|
||||
|
||||
-- When alr self-compiles it inserts a call to this function, so the dependency root is stablished
|
||||
|
||||
function Set (Project : Project_Name;
|
||||
Version : Semantic_Versioning.Version;
|
||||
function Set (Project : Name_String;
|
||||
Version : Semantic_Versioning.Version;
|
||||
Dependencies : Conditional.Dependencies := Conditional.For_Dependencies.Empty)
|
||||
return Releases.Release;
|
||||
-- This function must be called in the working project alire file.
|
||||
|
||||
+8
-9
@@ -10,17 +10,16 @@ package Alire with Preelaborate is
|
||||
Max_Name_Length : constant := 72; -- Github maximum is 100 and bitbucket 128, but since Description is 72...
|
||||
Max_Description_Length : constant := 72; -- Git line recommendation (although it's 50 for subject line)
|
||||
|
||||
-- Basics of projects: Name and Description
|
||||
-- Rest of properties are grouped in the Index
|
||||
-- Strings that are used quite generally
|
||||
|
||||
subtype Project_Name is String with Dynamic_Predicate =>
|
||||
Project_Name'Length >= 3 and then
|
||||
Project_Name'Length <= Max_Name_Length and then
|
||||
Project_Name (Project_Name'First) /= '_' and then
|
||||
(for all C of Project_Name => C in 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_');
|
||||
subtype Name_String is String with Dynamic_Predicate =>
|
||||
Name_String'Length >= 3 and then
|
||||
Name_String'Length <= Max_Name_Length and then
|
||||
Name_String (Name_String'First) /= '_' and then
|
||||
(for all C of Name_String => C in 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_');
|
||||
|
||||
subtype Project_Description is String with Dynamic_Predicate =>
|
||||
Project_Description'Length <= Max_Description_Length;
|
||||
subtype Description_String is String with Dynamic_Predicate =>
|
||||
Description_String'Length <= Max_Description_Length;
|
||||
|
||||
subtype Folder_String is String with Dynamic_Predicate =>
|
||||
Folder_String'Length > 0 and then
|
||||
|
||||
Reference in New Issue
Block a user