First sample dependent libraries
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Object files
|
# Object files
|
||||||
|
lib
|
||||||
obj
|
obj
|
||||||
*.o
|
|
||||||
|
|
||||||
# Ada Library Information
|
# Ada Library Information
|
||||||
*.ali
|
*.ali
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "deps/semver"]
|
||||||
|
path = deps/semver
|
||||||
|
url = git@bitbucket.org:aleteolabs/semver.git
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package Alire.Versions is
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end Alire.Versions;
|
|
||||||
@@ -16,11 +16,12 @@ project Alire is
|
|||||||
end Builder;
|
end Builder;
|
||||||
|
|
||||||
package Compiler is
|
package Compiler is
|
||||||
for Switches ("ada") use ("-gnatwa", "-gnatVa", "-g", "-O2", "-gnat12", "-gnato", "-fstack-check", "-gnata");
|
for Switches ("ada") use ("-gnatwa", "-gnatVa", "-g", "-p", "-O2", "-gnat12",
|
||||||
|
"-gnato", "-fstack-check", "-gnata");
|
||||||
end Compiler;
|
end Compiler;
|
||||||
|
|
||||||
package Binder is
|
package Binder is
|
||||||
for Switches ("ada") use ("-E", "-shared");
|
for Switches ("ada") use ("-Es", "-shared");
|
||||||
end Binder;
|
end Binder;
|
||||||
|
|
||||||
package Ide is
|
package Ide is
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
aggregate project Alire_Env is
|
||||||
|
|
||||||
|
for Project_Path use ("deps/semver");
|
||||||
|
|
||||||
|
for Project_Files use ("alire.gpr");
|
||||||
|
|
||||||
|
end Alire_Env;
|
||||||
+1
Submodule deps/semver added at 3c50e076d4
@@ -1,11 +1,16 @@
|
|||||||
|
with Alire.Index.Libhello;
|
||||||
|
|
||||||
package Alire.Index.Hello is
|
package Alire.Index.Hello is
|
||||||
|
|
||||||
Hello : constant Project := Git_Project ("hello",
|
Name : constant Project_Name := "hello";
|
||||||
"git@bitbucket.org:aleteolabs/hello.git");
|
Repo : constant URL := "git@bitbucket.org:aleteolabs/hello.git";
|
||||||
|
|
||||||
V_1_0_0 : constant Milestone := Register (Git_Release (
|
V_1_0_0 : constant Release :=
|
||||||
Hello,
|
Register_Git (Name,
|
||||||
V ("1.0.0"),
|
V ("1.0.0"),
|
||||||
"8cac0afddc505794ae3e5634745ce0830129d241"));
|
Repo,
|
||||||
|
"8cac0afddc505794ae3e5634745ce0830129d241",
|
||||||
|
-- Depends_On ("libhello", At_Least_Within_Major (V ("1.0.0"))));
|
||||||
|
Depends_On => At_Least_Within_Major (Libhello.V_1_0_0));
|
||||||
|
|
||||||
end Alire.Index.Hello;
|
end Alire.Index.Hello;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package Alire.Index.Libhello is
|
package Alire.Index.Libhello is
|
||||||
|
|
||||||
Libhello : constant Project := Git_Project ("libhello",
|
Name : constant Project_Name := "libhello";
|
||||||
"git@bitbucket.org:aleteolabs/libhello.git");
|
Repo : constant URL := "git@bitbucket.org:aleteolabs/libhello.git";
|
||||||
|
|
||||||
V_1_0_0 : constant Milestone := Register (Git_Release (
|
V_1_0_0 : constant Release :=
|
||||||
Libhello,
|
Register_Git (Name,
|
||||||
V ("1.0.0"),
|
V ("1.0.0"),
|
||||||
"ce78e7706c9d3f97605df48d8befca5407f8d328"));
|
Repo,
|
||||||
|
"ce78e7706c9d3f97605df48d8befca5407f8d328");
|
||||||
|
|
||||||
end Alire.Index.Libhello;
|
end Alire.Index.Libhello;
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package body Alire.Index is
|
||||||
|
|
||||||
|
function Register (Project : Project_Name;
|
||||||
|
Version : Semantic_Versioning.Version;
|
||||||
|
Hosting : Repositories.Repository'Class;
|
||||||
|
Id : Repositories.Release_Id;
|
||||||
|
Depends_On : Dependencies := Nothing;
|
||||||
|
License : Licenses := Unknown) return Release is
|
||||||
|
begin
|
||||||
|
return (null record);
|
||||||
|
end Register;
|
||||||
|
|
||||||
|
end Alire.Index;
|
||||||
+60
-22
@@ -3,36 +3,74 @@ with Alire.Repositories.Git;
|
|||||||
with Semantic_Versioning;
|
with Semantic_Versioning;
|
||||||
|
|
||||||
package Alire.Index with Preelaborate is
|
package Alire.Index with Preelaborate is
|
||||||
|
|
||||||
|
function V (Semantic_Version : String) return Semantic_Versioning.Version
|
||||||
|
renames Semantic_Versioning.New_Version;
|
||||||
|
|
||||||
|
type Release (<>) is private;
|
||||||
|
|
||||||
|
function Register (Project : Project_Name;
|
||||||
|
Version : Semantic_Versioning.Version;
|
||||||
|
Hosting : Repositories.Repository'Class;
|
||||||
|
Id : Repositories.Release_Id;
|
||||||
|
Depends_On : Dependencies := Nothing;
|
||||||
|
License : Licenses := Unknown) return Release;
|
||||||
|
|
||||||
|
function Register_Git (Project : Project_Name;
|
||||||
|
Version : Semantic_Versioning.Version;
|
||||||
|
Hosting : URL;
|
||||||
|
Commit : Repositories.Git.Commit_ID;
|
||||||
|
Depends_On : Dependencies := Nothing;
|
||||||
|
License : Licenses := Unknown) return Release;
|
||||||
|
|
||||||
type Milestone (<>) is private;
|
-- Shortcuts to give dependencies:
|
||||||
|
|
||||||
function Register (Released : Release;
|
function At_Least_Within_Major (R : Release) return Dependencies;
|
||||||
Depends_On : Dependencies := Nothing) return Milestone;
|
|
||||||
-- General registering function
|
|
||||||
|
|
||||||
|
function At_Least (V : Release) return Dependencies;
|
||||||
|
function At_Most (V : Release) return Dependencies;
|
||||||
|
function Less_Than (V : Release) return Dependencies;
|
||||||
|
function More_Than (V : Release) return Dependencies;
|
||||||
|
function Exactly (V : Release) return Dependencies;
|
||||||
|
function Except (V : Release) return Dependencies;
|
||||||
|
|
||||||
|
subtype Version is Semantic_Versioning.Version;
|
||||||
-- SHORTCUTS TO SIMPLIFY INDEX ENTRIES REGISTRATION --
|
subtype Version_Set is Semantic_Versioning.Version_Set;
|
||||||
|
|
||||||
function V (Semantic_Version : String) return Semantic_Versioning.Version renames Semantic_Versioning.New_Version;
|
function At_Least_Within_Major (V : Version) return Version_Set renames Semantic_Versioning.At_Least_Within_Major;
|
||||||
|
|
||||||
|
function At_Least (V : Version) return Version_Set renames Semantic_Versioning.At_Least;
|
||||||
|
function At_Most (V : Version) return Version_Set renames Semantic_Versioning.At_Most;
|
||||||
function Git_Project (Name : Project_Name; Git_URL : String) return Project;
|
function Less_Than (V : Version) return Version_Set renames Semantic_Versioning.Less_Than;
|
||||||
|
function More_Than (V : Version) return Version_Set renames Semantic_Versioning.More_Than;
|
||||||
function Git_Release (Prj : Project;
|
function Exactly (V : Version) return Version_Set renames Semantic_Versioning.Exactly;
|
||||||
Version : Semantic_Versioning.Version;
|
function Except (V : Version) return Version_Set renames Semantic_Versioning.Except;
|
||||||
Commit : Repositories.Git.Commit_ID) return Release;
|
|
||||||
|
|
||||||
function Register_Git_Milestone (Name : Project_Name;
|
|
||||||
Version : Semantic_Versioning.Version;
|
|
||||||
Git_URL : String;
|
|
||||||
Commit : Repositories.Git.Commit_ID;
|
|
||||||
Depends_On : Dependencies := Nothing) return Milestone;
|
|
||||||
-- Single git releases
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
type Milestone is null record;
|
type Release is null record;
|
||||||
|
|
||||||
|
function Register_Git (Project : Project_Name;
|
||||||
|
Version : Semantic_Versioning.Version;
|
||||||
|
Hosting : URL;
|
||||||
|
Commit : Repositories.Git.Commit_ID;
|
||||||
|
Depends_On : Dependencies := Nothing;
|
||||||
|
License : Licenses := Unknown) return Release
|
||||||
|
is (Register (Project,
|
||||||
|
Version,
|
||||||
|
Repositories.Git.New_Repository (String (Hosting)),
|
||||||
|
Repositories.Release_Id (Commit),
|
||||||
|
Depends_On,
|
||||||
|
License));
|
||||||
|
|
||||||
|
function At_Least_Within_Major (R : Release) return Dependencies is (null record);
|
||||||
|
|
||||||
|
function At_Least (V : Release) return Dependencies is (null record);
|
||||||
|
function At_Most (V : Release) return Dependencies is (null record);
|
||||||
|
function Less_Than (V : Release) return Dependencies is (null record);
|
||||||
|
function More_Than (V : Release) return Dependencies is (null record);
|
||||||
|
function Exactly (V : Release) return Dependencies is (null record);
|
||||||
|
function Except (V : Release) return Dependencies is (null record);
|
||||||
|
|
||||||
|
|
||||||
end Alire.Index;
|
end Alire.Index;
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ package Alire.Repositories.Git with Preelaborate is
|
|||||||
|
|
||||||
type Repository (<>) is new Repositories.Repository with private;
|
type Repository (<>) is new Repositories.Repository with private;
|
||||||
|
|
||||||
subtype Commit_ID is String (1 .. 40);
|
function New_Repository(URL : String) return Repository;
|
||||||
|
|
||||||
function New_Git_Repo (URL : String) return Repository;
|
subtype Commit_ID is String (1 .. 40);
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
type Repository (URL_Length : Natural) is new Repositories.Repository with record
|
type Repository (URL_Length : Natural) is new Repositories.Repository with record
|
||||||
URL : String (1 .. URL_Length);
|
URL : String (1 .. URL_Length);
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
function New_Repository (URL : String) return Repository
|
||||||
|
is (URL_Length => Url'Length,
|
||||||
|
URL => URL);
|
||||||
|
|
||||||
end Alire.Repositories.Git;
|
end Alire.Repositories.Git;
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ package Alire.Repositories with Preelaborate is
|
|||||||
|
|
||||||
type Repository is interface;
|
type Repository is interface;
|
||||||
|
|
||||||
type Commit_ID is new String;
|
type Release_Id is new String;
|
||||||
|
|
||||||
end Alire.Repositories;
|
end Alire.Repositories;
|
||||||
|
|||||||
+15
-26
@@ -1,50 +1,39 @@
|
|||||||
limited with Alire.Repositories;
|
|
||||||
|
|
||||||
with Semantic_Versioning;
|
with Semantic_Versioning;
|
||||||
|
|
||||||
package Alire with Preelaborate is
|
package Alire with Preelaborate is
|
||||||
|
|
||||||
type Project (<>) is private;
|
type URL is new String;
|
||||||
-- A name + Storage location
|
|
||||||
|
|
||||||
|
|
||||||
type Project_Name is new String;
|
type Project_Name is new String;
|
||||||
|
|
||||||
function New_Project (Name : Project_Name;
|
|
||||||
Repo : Repositories.Repository'Class) return Project;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type Release (<>) is private;
|
|
||||||
|
|
||||||
function New_Release (Prj : Project;
|
|
||||||
Version : Semantic_Versioning.Version;
|
|
||||||
Commit : Repositories.Commit_ID) return Release;
|
|
||||||
|
|
||||||
|
|
||||||
|
type Licenses is (Unknown);
|
||||||
|
|
||||||
|
|
||||||
type Dependency (<>) is private;
|
|
||||||
|
|
||||||
type Dependencies (<>) is private;
|
type Dependencies (<>) is private;
|
||||||
|
|
||||||
Nothing : constant Dependencies;
|
Nothing : constant Dependencies;
|
||||||
|
|
||||||
function New_Dependency (Name : Project_Name; Versions : Semantic_Versioning.Version_Set) return Dependency;
|
function New_Dependency (Name : Project_Name;
|
||||||
|
Versions : Semantic_Versioning.Version_Set) return Dependencies;
|
||||||
|
function Depends_On (Name : Project_Name;
|
||||||
|
Versions : Semantic_Versioning.Version_Set) return Dependencies renames New_Dependency;
|
||||||
|
|
||||||
function "and" (Dep1, Dep2 : Dependency) return Dependencies;
|
function "and" (Dep1, Dep2 : Dependencies) return Dependencies;
|
||||||
function "and" (Deps : Dependencies; Dep : Dependency) return Dependencies;
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
type Dependency is null record;
|
|
||||||
|
|
||||||
type Dependencies is null record;
|
type Dependencies is null record;
|
||||||
|
|
||||||
Nothing : constant Dependencies := (null record);
|
Nothing : constant Dependencies := (null record);
|
||||||
|
|
||||||
type Project is null record;
|
|
||||||
|
|
||||||
type Release is null record;
|
function New_Dependency (Name : Project_Name;
|
||||||
|
Versions : Semantic_Versioning.Version_Set) return Dependencies
|
||||||
type Release_Set is null record;
|
is (null record);
|
||||||
|
|
||||||
|
function "and" (Dep1, Dep2 : Dependencies) return Dependencies is (null record);
|
||||||
|
|
||||||
end Alire;
|
end Alire;
|
||||||
|
|||||||
Reference in New Issue
Block a user