First sample dependent libraries
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Object files
|
||||
lib
|
||||
obj
|
||||
*.o
|
||||
|
||||
# Ada Library Information
|
||||
*.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;
|
||||
|
||||
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;
|
||||
|
||||
package Binder is
|
||||
for Switches ("ada") use ("-E", "-shared");
|
||||
for Switches ("ada") use ("-Es", "-shared");
|
||||
end Binder;
|
||||
|
||||
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
|
||||
|
||||
Hello : constant Project := Git_Project ("hello",
|
||||
"git@bitbucket.org:aleteolabs/hello.git");
|
||||
Name : constant Project_Name := "hello";
|
||||
Repo : constant URL := "git@bitbucket.org:aleteolabs/hello.git";
|
||||
|
||||
V_1_0_0 : constant Milestone := Register (Git_Release (
|
||||
Hello,
|
||||
V ("1.0.0"),
|
||||
"8cac0afddc505794ae3e5634745ce0830129d241"));
|
||||
V_1_0_0 : constant Release :=
|
||||
Register_Git (Name,
|
||||
V ("1.0.0"),
|
||||
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;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package Alire.Index.Libhello is
|
||||
|
||||
Libhello : constant Project := Git_Project ("libhello",
|
||||
"git@bitbucket.org:aleteolabs/libhello.git");
|
||||
Name : constant Project_Name := "libhello";
|
||||
Repo : constant URL := "git@bitbucket.org:aleteolabs/libhello.git";
|
||||
|
||||
V_1_0_0 : constant Milestone := Register (Git_Release (
|
||||
Libhello,
|
||||
V ("1.0.0"),
|
||||
"ce78e7706c9d3f97605df48d8befca5407f8d328"));
|
||||
V_1_0_0 : constant Release :=
|
||||
Register_Git (Name,
|
||||
V ("1.0.0"),
|
||||
Repo,
|
||||
"ce78e7706c9d3f97605df48d8befca5407f8d328");
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
Depends_On : Dependencies := Nothing) return Milestone;
|
||||
-- General registering function
|
||||
function At_Least_Within_Major (R : Release) return Dependencies;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
-- SHORTCUTS TO SIMPLIFY INDEX ENTRIES REGISTRATION --
|
||||
subtype Version is Semantic_Versioning.Version;
|
||||
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 Git_Project (Name : Project_Name; Git_URL : String) return Project;
|
||||
|
||||
function Git_Release (Prj : Project;
|
||||
Version : Semantic_Versioning.Version;
|
||||
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
|
||||
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 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 Exactly (V : Version) return Version_Set renames Semantic_Versioning.Exactly;
|
||||
function Except (V : Version) return Version_Set renames Semantic_Versioning.Except;
|
||||
|
||||
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;
|
||||
|
||||
@@ -2,14 +2,18 @@ package Alire.Repositories.Git with Preelaborate is
|
||||
|
||||
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
|
||||
|
||||
type Repository (URL_Length : Natural) is new Repositories.Repository with record
|
||||
URL : String (1 .. URL_Length);
|
||||
end record;
|
||||
|
||||
function New_Repository (URL : String) return Repository
|
||||
is (URL_Length => Url'Length,
|
||||
URL => URL);
|
||||
|
||||
end Alire.Repositories.Git;
|
||||
|
||||
@@ -2,6 +2,6 @@ package Alire.Repositories with Preelaborate is
|
||||
|
||||
type Repository is interface;
|
||||
|
||||
type Commit_ID is new String;
|
||||
type Release_Id is new String;
|
||||
|
||||
end Alire.Repositories;
|
||||
|
||||
+15
-26
@@ -1,50 +1,39 @@
|
||||
limited with Alire.Repositories;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire with Preelaborate is
|
||||
|
||||
type Project (<>) is private;
|
||||
-- A name + Storage location
|
||||
type URL 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;
|
||||
|
||||
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" (Deps : Dependencies; Dep : Dependency) return Dependencies;
|
||||
function "and" (Dep1, Dep2 : Dependencies) return Dependencies;
|
||||
|
||||
private
|
||||
|
||||
type Dependency is null record;
|
||||
|
||||
type Dependencies is null record;
|
||||
|
||||
Nothing : constant Dependencies := (null record);
|
||||
|
||||
type Project is null record;
|
||||
|
||||
type Release is null record;
|
||||
|
||||
type Release_Set is null record;
|
||||
function New_Dependency (Name : Project_Name;
|
||||
Versions : Semantic_Versioning.Version_Set) return Dependencies
|
||||
is (null record);
|
||||
|
||||
function "and" (Dep1, Dep2 : Dependencies) return Dependencies is (null record);
|
||||
|
||||
end Alire;
|
||||
|
||||
Reference in New Issue
Block a user