Module Assemblage.Dir

module Dir: sig .. end
Directory part.

A directory part defines a clean directory in which a selection of part products (both source and build) can be gathered and renamed. Directory parts can be marked as being Assemblage.Dir.installable; drivers can use this information to devise an installation procedure for your project's outcomes.



Metadata


type kind = [ `Bin
| `Doc
| `Etc
| `Lib
| `Man
| `Other of Assemblage.Path.t
| `Sbin
| `Share
| `Share_root
| `Stublibs
| `Toplevel ]
The type for kinds of directories. They essentially correspond to the sections of an OPAM install file.
val pp_kind : Format.formatter -> kind -> unit
pp_kind ppf k prints an unspecified representation of k on ppf.
val kind : [< `Dir ] Assemblage.part -> kind
kind p is p's kind.
val install : [< `Dir ] Assemblage.part -> bool
kind p is true if the directory contents is meant to be installed.

Directory specifiers

FIXME a few combinators to quickly devise spec values would be welcome, e.g. put a specific part in sub directory, etc.

type spec = Assemblage.Part.kind Assemblage.Part.t ->
(Assemblage.Path.t * Assemblage.Path.rel option) list Assemblage.Conf.value
The type for directory specifier.

Given a part p it returns a list of tuples (prod, path), where prod is a product of p to add to the directory and path specifies under which name, relative to the directory, it should be added. If path is None and prod is in p's build root directory, the path relative to this directory is used.

val all : spec
all is a specifier that keeps any product of any part.
val all_output : spec
all_output is a specifier that keeps any output product of any part.
val all_input : spec
all_input is a specifier that keeps any input product of any part.
val file_exts : Assemblage.Path.ext list -> spec
file_exts exts is a specifier that keeps, in any part, products that have an extension in exts.
val bin : spec
bin is Assemblage.Dir.all_output except in the following cases:
val lib : spec
lib is Assemblage.Dir.all_output except in the following cases:
val doc : spec
doc is Assemblage.Dir.all except in the following cases:

Dir


val v : ?usage:Assemblage.Part.usage ->
?exists:bool Assemblage.Conf.value ->
?args:Assemblage.Args.t ->
?spec:spec ->
?install:bool ->
kind ->
[< `Base | `Bin | `Dir | `Doc | `Lib | `Unit ] Assemblage.part list ->
[< Assemblage.part_kind > `Dir ] Assemblage.part
v spec install kind needs is a directory of type kind that gathers the products of existing needs as determined by the directory specifier spec.

If install is true the directory structure is meant to be installed at a root location defined by kind. install defaults to true except for kind `Other.

The name of the part is automatically derived from kind in the obvious way. For `Other p the name is the basename of p.

The default for spec depends in kind as follows:

Note. Due to the way assemblage and ocamldoc work, trying to install a `Doc part will be disappointing.