Module Brzo_outcome

Outcomes

Outcomes

type 'a build_dir_suff = B00.Memo.t -> Brzo.Conf.t -> 'a -> string B00.Memo.fiber

The type for build directory suffix determination. build_dir c dc is a suffix added to the build directory name. It can be used if your outcome has multiple targets (see e.g. the OCaml domain) and you would like to be able to have them live in parallel in the build dir.

type 'a artefact = B00.Memo.t -> Brzo.Conf.t -> 'a -> build_dir:B0_std.Fpath.t -> B0_std.Fpath.t B00.Memo.fiber

The type for outcome artefact path determination. artefact c dc ~build_dir is the absolute path, contained in the domain specific build_dir to the outcome artefact (can be a directory).

type 'a build = B00.Memo.t -> Brzo.Conf.t -> 'a -> build_dir:B0_std.Fpath.t -> artefact:B0_std.Fpath.t -> srcs:B0_fexts.map -> unit B00.Memo.fiber

The type for outcome artefact constructions. build m c dc ~build_dir ~artefact ~srcs builds artefact from srcs using m. build_dir is clean and the function can Memo.fail. artefact is the result of the artefact function.

type 'a action = B00.Memo.t -> Brzo.Conf.t -> 'a -> build_dir:B0_std.Fpath.t -> artefact:B0_std.Fpath.t -> (unit -> (unit, string) Stdlib.result) B00.Memo.fiber

The type for outcome action. action c dc ~outcome ~artefact returns the action of outcome on artefact (already tested for existence and constructed by the outcome's artefact function). When the function is called it is made sure that build was called and blocked and that it didn't error.

type 'a t

The type for outcomes with domain specific configuration of type 'a.

val v : id:string -> doc:string -> ?⁠build_dir_suff:'a build_dir_suff -> artefact:'a artefact -> build:'a build -> action_has_args:bool -> action:'a action -> unit -> 'a t

v defines an outcome. See the corresponding accessors for the semantics of arguments. build_dir_suff defaults to fun _ _ -> "".

val id : 'a t -> string

id o is the outcome identifier. Used in particular to define the command line option to select the outcome.

val doc : 'a t -> string

doc o is a Cmdliner argument doc string for the outcome.

val build_dir_suff : 'a t -> 'a build_dir_suff

build_dir_suff o is o's build directory suffix function.

val artefact : 'a t -> 'a artefact

artefact o is o's artefact determination function.

val build : 'a t -> 'a build

build o is o's build function.

val action_has_args : 'a t -> bool

action_has_args o is true iff only the outcome action supports cli args.

val action : 'a t -> 'a action

action o is o's action function.

val with_outcome : id:string -> doc:string -> 'a t -> 'a t

with_outcome ~id ~doc o is o with identifier and doc string respectively changed to id and doc.

val get : string -> 'a t list -> 'a t
val run : B00.Memo.t -> Brzo.Conf.t -> 'a -> string -> 'a t -> [ `Exec of unit -> (unit, string) Stdlib.result | `Exit of int ] B00.Memo.fiber

Predefined actions

module Action : sig ... end

Predefined actions.