Better expression requisites
This commit is contained in:
@@ -5,36 +5,45 @@ with Alire.Requisites.Comparables;
|
||||
|
||||
package Alire.Requisites.Platform with Preelaborate is
|
||||
|
||||
package Plat renames Properties.Platform;
|
||||
package Ps renames Platforms;
|
||||
package PrPl renames Properties.Platform;
|
||||
|
||||
use all type Platforms.Compilers;
|
||||
use all type Ps.Compilers;
|
||||
use all type Tree;
|
||||
|
||||
package Systs is new Comparables
|
||||
(Platforms.Operating_Systems, Platforms."<", Platforms.Operating_Systems'Image,
|
||||
Properties.Platform.Operating_Systems.Property,
|
||||
Properties.Platform.Operating_Systems.Element,
|
||||
package Op_Systems is new Comparables
|
||||
(Ps.Operating_Systems, Ps."<", Ps.Operating_Systems'Image,
|
||||
PrPl.Operating_Systems.Property,
|
||||
PrPl.Operating_Systems.Element,
|
||||
"OS");
|
||||
|
||||
package Compilers is new Requisites.For_Value_Property (Plat.Compilers, "Compiler");
|
||||
function Compiler_Is (V : Platforms.Compilers) return Tree renames Compilers.New_Equality;
|
||||
|
||||
package Compilers_Less is new Compilers.Comparators (Platforms."<", "<");
|
||||
function Compiler_Less_Than (V : Platforms.Compilers) return Tree renames Compilers_Less.New_Comparator;
|
||||
package Compilers is new Comparables
|
||||
(Ps.Compilers, Ps."<", Ps.Compilers'Image,
|
||||
PrPl.Compilers.Property,
|
||||
PrPl.Compilers.Element,
|
||||
"Compiler");
|
||||
|
||||
use all type Compilers.Comparable;
|
||||
function Compiler is new Compilers.Factory;
|
||||
function Compiler_Is_Native return Tree is
|
||||
(Compiler_Less_Than (GNAT_GPL_2017) and not Compiler_Is (GNAT_Unknown));
|
||||
(Compiler < GNAT_GPL_2017 and Compiler /= GNAT_Unknown);
|
||||
|
||||
package Distributions is new Requisites.For_Value_Property (Plat.Distributions, "Distribution");
|
||||
function Distribution_Is (V : Platforms.Distributions) return Tree renames Distributions.New_Equality;
|
||||
package Distributions is new Comparables
|
||||
(Ps.Distributions, Ps."<", Ps.Distributions'Image,
|
||||
PrPl.Distributions.Property,
|
||||
PrPl.Distributions.Element,
|
||||
"Distribution");
|
||||
|
||||
package Systems is new Requisites.For_Value_Property (Plat.Operating_Systems, "OS");
|
||||
function System_Is (V : Platforms.Operating_Systems) return Tree renames Systems.New_Equality;
|
||||
package Versions is new Comparables
|
||||
(Ps.Versions, Ps."<", Ps.Versions'Image,
|
||||
PrPl.Versions.Property,
|
||||
PrPl.Versions.Element,
|
||||
"Version");
|
||||
|
||||
package Versions is new Requisites.For_Value_Property (Plat.Versions, "Version");
|
||||
function Version_Is (V : Platforms.Versions) return Tree renames Versions.New_Equality;
|
||||
|
||||
package Word_Sizes is new Requisites.For_Value_Property (Plat.Word_Sizes, "Arquitecture width");
|
||||
function Word_Size_Is (V : Platforms.Word_Sizes) return Tree renames Word_Sizes.New_Equality;
|
||||
package Word_Sizes is new Comparables
|
||||
(Ps.Word_Sizes, Ps."<", Ps.Word_Sizes'Image,
|
||||
PrPl.Word_Sizes.Property,
|
||||
PrPl.Word_Sizes.Element,
|
||||
"Word_Size");
|
||||
|
||||
end Alire.Requisites.Platform;
|
||||
|
||||
Reference in New Issue
Block a user