Module Assemblage.Unit

module Unit: sig .. end
Compilation unit part.

Defines a compilation unit's build products in a build directory defined by an enclosing Assemblage.Lib or Assemblage.Bin part.



Metadata


type ocaml_interface = [ `Hidden | `Normal | `Opaque ] 
The type for OCaml compilation unit interfaces.

Adds additional information about how the interface of a compilation unit should be treated.


type ocaml_unit = [ `Both | `Ml | `Mli ] 
The type for OCaml compilation units.
type c_unit = [ `Both | `C | `H ] 
The type for C Compilation units
type kind = [ `C of c_unit
| `Js
| `OCaml of ocaml_unit * ocaml_interface ]
The type for kinds of compilation units
val pp_kind : Format.formatter -> kind -> unit
pp_kind ppf k prints an unspecified representation of k on ppf.
val kind : [< `Unit ] Assemblage.part -> kind
kind u is the kind of u.
val dir : [< `Unit ] Assemblage.part -> Assemblage.Path.t Assemblage.Conf.value
dir u is the directory where the unit u is located.
val ocaml : [< Assemblage.part_kind ] Assemblage.part ->
[< Assemblage.part_kind > `Unit ] Assemblage.part option
ocaml p is Some p iff p is an OCaml compilation unit.
val c : [< Assemblage.part_kind ] Assemblage.part ->
[< Assemblage.part_kind > `Unit ] Assemblage.part option
c p is Some p iff p is a C compilation unit.
val js : [< Assemblage.part_kind ] Assemblage.part ->
[< Assemblage.part_kind > `Unit ] Assemblage.part option
js p is Some p iff p is a JavaScript compilation unit.

Units


val v : ?usage:Assemblage.Part.usage ->
?exists:bool Assemblage.Conf.value ->
?args:Assemblage.Args.t ->
?needs:[< `Lib | `Pkg ] Assemblage.part list ->
?dir:Assemblage.Path.t Assemblage.Conf.value ->
string ->
kind -> [< Assemblage.part_kind > `Unit ] Assemblage.part
v ~needs ~dir name kind is a compilation unit named name, the name of the file without the suffix located in directory dir (defaults to Assemblage.root) of kind kind. needs indicate the project libraries and packages that are needed to compile the unit. The args bundle is used by the unit's actions according to context.