package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.5.tbz
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e

doc/b0/B0_driver/index.html

Module B0_driverSource

B0 file drivers.

B0 file drivers access the definitions of B0 files. See this manual for an overview and a minimal example.

Commonalities

Sourcemodule Exit : sig ... end

Driver exit codes.

Sourcemodule Env : sig ... end

Driver environment variables.

Sourcemodule Conf : sig ... end

Driver configuration.

Sourcemodule Cli : sig ... end

Cli interaction.

Drivers

The type for driver main functions. A function that returns a Cmdliner evaluation result. This evaluation result is used by run to handle program termination. Note that the driver may exit prematurely with Exit.b0_file_error if there's a fatal error in the B0 file.

Sourcetype t

The type for drivers.

Sourceval create : name:string -> version:string -> libs:B00_ocaml.Lib.Name.t list -> t

create ~name ~version is a new driver named name which has version version and uses library libs to link the B0 file. Note that these libraries are not added during the compilation phase.

Note. The b0 libraries are automatically added to libs there's no need to mention them. Just mention your driver library and its dependencies in order.

Sourceval name : t -> string

name d is the name of d.

Sourceval version : t -> string

version d is the version of d.

Sourceval libs : t -> B00_ocaml.Lib.Name.t list

libs d are the libraries that need to be added for linking.

Sourceval set : driver:t -> main:main -> unit

set d sets the driver to d and its main function to main. Use run to run the driver.

Sourceval run : has_b0_file:bool -> unit

run ~has_b0_file runs the driver set by set. has_b0_file must be true if the B0 file is linked in, this is typically done by the B0 file expanded source invocation. Raises Invalid_argument if no driver is set.

Require the B0 file

with_b0_file ~driver cmd wraps cmd to make sure it runs with the B0 file compiled and linked in as specified by driver.

Sourceval has_b0_file : unit -> bool

has_b0_file () is true if run is called with has_b0_file.

Compilation

Sourcemodule Compile : sig ... end

Driver compilation.