Module B0_unit

Build units.

A build unit is a named build procedure with metadata associated to it. Build units are the smallest unit of build in B0.

Build procedures

type build

The type for builds, see B0_build.

type proc = build -> unit B00_std.Fut.t

The type for unit build procedures. Note that when the future determines the build may not be finished.

val proc_nop : proc

proc_nop does nothing.


type action = build -> t -> args:string list -> B00_std.Os.Exit.t B00_std.Fut.t

The type for unit outcome actions. Defines an action to perform on build results. args are command line argument passed on the command line.

For example for executables a natural action is to execv them directly or via their runtime (see Action.exec). For built document files it can be to (re)load them in their corresponding viewer application, etc.

TODO. This is not a final design, see unit actions.

and t

The type for build units.

val v : ?doc:string -> ?meta:B0_meta.t -> ?action:action -> string -> proc -> t

v n proc ~doc ~meta ~action is a build unit named n with build procedure proc, synopsis doc and metada meta.

val proc : t -> proc

proc u are the unit's build procedure.

val action : t -> action option

action is the unit's outcome action.


module Action : sig ... end

B0 definition API

include B0_def.S with type t := t
val define : ?doc:string -> ?meta:B0_meta.t -> string -> B0_def.def
val def_kind : string
val def : t -> B0_def.def
val name : t -> string
val basename : t -> string
val doc : t -> string
val equal : t -> t -> bool
val compare : t -> t -> int
val meta : t -> B0_meta.t
val has_meta : 'a B0_meta.key -> t -> bool
val find_meta : 'a B0_meta.key -> t -> 'a option
val get_meta : 'a B0_meta.key -> t -> ('a, string) Stdlib.result
val add : t -> unit
val list : unit -> t list
val find : string -> t option
val get : string -> t
val get_or_suggest : string -> (tt list) Stdlib.result
val get_or_hint : string -> (t, string) Stdlib.result
val get_list_or_hint : ?empty_means_all:bool -> string list -> (t list, string) Stdlib.result
val pp_name_str : string B00_std.Fmt.t
val pp_name : t B00_std.Fmt.t
val pp_doc : t B00_std.Fmt.t
val pp_synopsis : t B00_std.Fmt.t
val pp : t B00_std.Fmt.t
module Set : sig ... end
module Map : sig ... end