package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=665735c8b7a8674201be765bdd676a18d1e38eff35de9d44c3dc15e2bfed2247e8963c9a32ae62d9ca2d6cd1edebd849aac29fdd5a846c14a30feea3edfc0601
doc/b0/B0_build/index.html
Module B0_build
B0 builds.
Centralizes the information to run and orchestrate a B0 build.
Build
type t = B0_unit.build
The type for builds.
val memo : t -> B00.Memo.t
memo b
the memoizer for the build.
Units
val must_build : t -> B0_unit.Set.t
must_build b
are the units in b
that must build.
val may_build : t -> B0_unit.Set.t
may_build b
are all the units in b
that may build, i.e. that can be required
. This includes the elements in must_build b
.
require b u
asks to build unit u
in b
. This fails the memo if b
is u
is not in may_build
.
current b
is b
's current unit. In the procedure of a build unit this is the unit itself.
Directories
FIXME Unify the directory story with B0_cmdlet
and B0_unit.Action
. We likely want to get rid of a few of the functions below.
val scope_dir : t -> B0_unit.t -> B00_std.Fpath.t
scope_dir b u
is the directory of the B0 file in which u
was defined. This is were unit relative paths like source files should be resolved.
val build_dir : t -> B0_unit.t -> B00_std.Fpath.t
build_dir b u
is the build directory for the build unit u
. This is where u
should write is build artefacts.
shared_build_dir
is a build directory shared by all units of the build. This is used by computations shared by units, most of the time one should rather use current_build_dir
.
val current_scope_dir : t -> B00_std.Fpath.t
current_scope_dir b
is root_dir b current
.
val current_build_dir : t -> B00_std.Fpath.t
current_unit_build_dir b
is build_dir b current
.
val in_build_dir : t -> B00_std.Fpath.t -> B00_std.Fpath.t
in_build_dir b p
is Fpath.(build_dir b current // p)
).
val in_scope_dir : t -> B00_std.Fpath.t -> B00_std.Fpath.t
in_scope_dir b p
is Fpath.(scope_dir b current // p)
).
in_shared_build_dir b p
is Fpath.(shared_build_dir b // p)
).
Store
val store : t -> B00.Store.t
store b
is the store for the build. Note that b
itself can be found in store via the self
key.
val get : t -> 'a B00.Store.key -> 'a B00_std.Fut.t
get b k
is B00.Store.get
(store b) k
.
val self : t B00.Store.key
self
is a store key that holds the build itself. The store returned by store
has this key bound to the build.
Creating and running
val create :
root_dir:B00_std.Fpath.t ->
b0_dir:B00_std.Fpath.t ->
variant:string ->
B00.Memo.t ->
may_build:B0_unit.Set.t ->
must_build:B0_unit.Set.t ->
t
create ~root_dir ~b0_dir m ~may_build ~must_build
must_build
are the build units that must be build byb
.may_build
are the build units that may build inb
.must
units are automatically added to this set.