First approach
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
with Alire.Repositories.Git;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire.Index with Preelaborate is
|
||||
|
||||
type Milestone (<>) is private;
|
||||
|
||||
function Register (Released : Release;
|
||||
Depends_On : Dependencies := Nothing) return Milestone;
|
||||
-- General registering function
|
||||
|
||||
|
||||
|
||||
-- SHORTCUTS TO SIMPLIFY INDEX ENTRIES REGISTRATION --
|
||||
|
||||
function V (Semantic_Version : String) return Semantic_Versioning.Version renames Semantic_Versioning.New_Version;
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
type Milestone is null record;
|
||||
|
||||
end Alire.Index;
|
||||
@@ -0,0 +1,15 @@
|
||||
package Alire.Repositories.Git with Preelaborate is
|
||||
|
||||
type Repository (<>) is new Repositories.Repository with private;
|
||||
|
||||
subtype Commit_ID is String (1 .. 40);
|
||||
|
||||
function New_Git_Repo (URL : String) return Repository;
|
||||
|
||||
private
|
||||
|
||||
type Repository (URL_Length : Natural) is new Repositories.Repository with record
|
||||
URL : String (1 .. URL_Length);
|
||||
end record;
|
||||
|
||||
end Alire.Repositories.Git;
|
||||
@@ -0,0 +1,7 @@
|
||||
package Alire.Repositories with Preelaborate is
|
||||
|
||||
type Repository is interface;
|
||||
|
||||
type Commit_ID is new String;
|
||||
|
||||
end Alire.Repositories;
|
||||
@@ -0,0 +1,50 @@
|
||||
limited with Alire.Repositories;
|
||||
|
||||
with Semantic_Versioning;
|
||||
|
||||
package Alire with Preelaborate is
|
||||
|
||||
type Project (<>) is private;
|
||||
-- A name + Storage location
|
||||
|
||||
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 Dependency (<>) is private;
|
||||
|
||||
type Dependencies (<>) is private;
|
||||
|
||||
Nothing : constant Dependencies;
|
||||
|
||||
function New_Dependency (Name : Project_Name; Versions : Semantic_Versioning.Version_Set) return Dependency;
|
||||
|
||||
function "and" (Dep1, Dep2 : Dependency) return Dependencies;
|
||||
function "and" (Deps : Dependencies; Dep : Dependency) 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;
|
||||
|
||||
end Alire;
|
||||
Reference in New Issue
Block a user