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 files.
The type for builds, see B0_build
.
type build_proc = b0_build -> unit B0_std.Fut.t
The type for unit build procedures. Note that when the future determines the build may not be finished.
val build_nop : build_proc
build_nop
does nothing.
val make : ?doc:string -> ?meta:B0_meta.t -> string -> build_proc -> t
make n proc ~doc ~meta ~action
is a build unit named n
with build procedure proc
, synopsis doc
and metada meta
.
val build_proc : t -> build_proc
proc u
are the unit's build procedure.
val tool_name : string B0_meta.key
tool_name
is an executable name without the platform specific executable extension.
val exe_file : B0_std.Fpath.t B0_std.Fut.t B0_meta.key
exe_file
is an absolute file path to an executable build by the unit.
val outcomes : B0_std.Fpath.t list B0_std.Bval.t B0_meta.key
outcomes
is the set of public file outcomes.
val is_public : t -> bool
is_public u
is true
iff u
's meta has B0_meta.public
set to true
.
get_or_suggest_tool tool_name
are tools names whose tool_name
match tool_name
and are filtered by keep
val tool_is_user_accessible : t -> bool
tool_is_user_accessible u
assumes u
has a tool name. This then returns true
iff u
is_public
or in_root_scope
.
The type for execution environments, see B0_env
.
module Exec : sig ... end
Unit executions.
val define : ?doc:string -> ?meta:B0_meta.t -> string -> B0_def.def
val def : t -> B0_def.def
val name : t -> string
val basename : t -> string
val doc : t -> string
val mem_meta : 'a B0_meta.key -> t -> bool
val has_tag : bool B0_meta.key -> t -> bool
val find_meta : 'a B0_meta.key -> t -> 'a option
val find_or_default_meta : 'a B0_meta.key -> t -> 'a
val get_meta : 'a B0_meta.key -> t -> ('a, string) Stdlib.result
val add : t -> unit
val fold : (t -> 'a -> 'a) -> 'a -> 'a
val list : unit -> t list
val find : string -> t option
val get : string -> t
val get_or_hint : string -> (t, string) Stdlib.result
val get_list_or_hint :
all_if_empty:bool ->
string list ->
(t list, string) Stdlib.result
val scope_path : t -> string list
val in_root_scope : t -> bool
val in_current_scope : t -> bool
val scope_dir : t -> B0_std.Fpath.t option
val scope_dir' : t -> (B0_std.Fpath.t, string) Stdlib.result
val in_scope_dir : t -> B0_std.Fpath.t -> B0_std.Fpath.t option
val in_scope_dir' :
t ->
B0_std.Fpath.t ->
(B0_std.Fpath.t, string) Stdlib.result
val pp_name_str : string B0_std.Fmt.t
val pp_name : t B0_std.Fmt.t
val pp_doc : t B0_std.Fmt.t
val pp_synopsis : t B0_std.Fmt.t
val pp : t B0_std.Fmt.t
module Set : sig ... end
module Map : sig ... end
val tool_name_map : Set.t -> t B0_std.String.Map.t
tool_name_map units
are the user accessible tools defined by the set of units units
.