package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.kit/B0_opam/File/index.html

Module B0_opam.FileSource

opam file generation.

Sourcetype opam := t

Generic representation

Sourcetype value = [
  1. | `Raw of string
    (*

    A raw, unescaped value

    *)
  2. | `B of bool
    (*

    A boolean.

    *)
  3. | `S of string
    (*

    A string.

    *)
  4. | `L of bool * value list
    (*

    A list of values, the boolean indicates whether line-by-line rendering should be forced.

    *)
]

The type for opam values.

Sourcetype field = string * value

The type for opam fields. The field name and its value.

Sourcetype section = string * string option * t

The type for opam sections. The section name, the optional string and the contents of the section.

Sourceand comment = string

The type for comments.

Sourceand item = [
  1. | `Comment of comment
  2. | `Field of field
  3. | `Section of section
]

The type for items.

Sourceand t = item list

The type for generic opam file contents.

Sourceval v2 : item

v2 is opam-version: "2.0".

Sourceval to_string : opam -> normalize:bool -> t -> (string, string) result

to_string formats file contents to a string. If normalize is true this calls opam to lint and normalize the result.

Package files

Sourceval pkg_of_meta : with_name:bool -> B0_meta.t -> t

pkg_of_meta ~with_name m is an opam package file from m. Here's an account of how opam fields are populated by metadata keys.

Finally the contents of B0_opam.file_addendum is appended after the definition of these fields.

See B0_opam.pkg_meta_of_pack for deriving metadata from build packs.