Module B0.Pkg

module Pkg: sig .. end

Packages have no fundamental purpose in the build system, they are simply a way to collect a set of build units under a common name and attach arbitrary metadata to it. At the user interface level they allow to perform coarse grained action on build units. For description developers they can be used to collect unit metadata in order to generate packaging and deployement bureaucracy and checks.


type t 
The type for packages.
type id = int 
The type for package unique identifiers. Warning. The same package can be given different ids in different program runs.
val create : ?loc:B0.Def.loc -> ?doc:string -> ?meta:B0.Meta.Pkg.t -> string -> t
create ~doc n b is a package with name n documented by doc.

Warning. Packges must be defined at toplevel and are subject to namespacing, see details.

include B0.Def.S
val basename : t -> string
basename u is u's given base name, without the namespacing.
val id : t -> id
id u is u's unique identifier for the program run.
val meta : t -> B0.Meta.Pkg.t
meta u is u's metadata.
val meta_mem : 'a B0.Meta.Pkg.key -> t -> bool
meta_mem k u is true iff k is defined in u's meta.
val meta_find : 'a B0.Meta.Pkg.key -> t -> 'a option
meta_find k u is k's value in u's meta (if any).
val meta_get : 'a B0.Meta.Pkg.key -> t -> 'a
meta_get k u is like B0.Pkg.meta_find but
Raises Invalid_argument if k is not bound in u.
val has_tag : bool B0.Meta.Pkg.key -> t -> bool
has_tag k u is true iff k's value in u's meta is true.

Package id maps and sets

module Idset: sig .. end
Sets of package identifiers.
module Idmap: sig .. end
Maps of package identifiers.

Package map and sets

type set 
The type for sets of packages.
module Set: sig .. end
Package sets.
type +'a map 
The type for maps from units to values of type 'a.
module Map: sig .. end
Package maps.