topkg-care

The transitory OCaml software packager
IN THIS PACKAGE
Module Topkg_care . Pkg

Packages

type t

The type for package descriptions.

val v : ?name:string -> ?version:string -> ?delegate:Bos_setup.Cmd.t -> ?build_dir:Fpath.t -> ?opam:Fpath.t -> ?opam_descr:Fpath.t -> ?readme:Fpath.t -> ?change_log:Fpath.t -> ?license:Fpath.t -> ?distrib_uri:string -> ?distrib_file:Fpath.t -> ?publish_msg:string -> ?publish_artefacts:[ `Distrib | `Doc | `Alt of string ] list -> Fpath.t -> t

v pkg_file is a package from description file pkg_file which is loaded only if needed. The optional parameters allow to override pkg_file's definition.

val pkg_file : t -> Fpath.t

pkg_file p is p's description file.

val name : t -> ( string, Bos_setup.R.msg ) Bos_setup.result

name p is p's name.

val version : t -> ( string, Bos_setup.R.msg ) Bos_setup.result

version p is p's version string.

delegate p is p's delegate.

val build_dir : t -> ( Fpath.t, Bos_setup.R.msg ) Bos_setup.result

build_dir p is p's build directory.

opam p is p's opam file.

val opam_descr : t -> ( Opam.Descr.t * bool, Bos_setup.R.msg ) Bos_setup.result

opam_descr p is p's opam description. The boolean indicates if the description was found in the opam file itself.

val opam_field : t -> string -> ( string list option, Bos_setup.R.msg ) Bos_setup.result

opam_field p f looks up field f of p's opam file.

val opam_fields : t -> ( string list Bos_setup.String.map, Bos_setup.R.msg ) Bos_setup.result

opam_fields p are p's opam file fields.

val readmes : t -> ( Fpath.t list, Bos_setup.R.msg ) Bos_setup.result

readmes p are p's readme files.

readme p is the first element of readmes p.

val change_logs : t -> ( Fpath.t list, Bos_setup.R.msg ) Bos_setup.result

change_logs p are p's change logs.

val change_log : t -> ( Fpath.t, Bos_setup.R.msg ) Bos_setup.result

change_log p is the first element of change_logs p.

val licenses : t -> ( Fpath.t list, Bos_setup.R.msg ) Bos_setup.result

licenses p are p's license files.

val distrib_uri : ?raw:bool -> t -> ( string, Bos_setup.R.msg ) Bos_setup.result

distrib_uri p is p's distribution URI. If raw is true defaults to false, p's raw URI distribution pattern is returned.

val distrib_file : t -> ( Fpath.t, Bos_setup.R.msg ) Bos_setup.result

distrib_file p is p's distribution archive.

val publish_msg : t -> ( string, Bos_setup.R.msg ) Bos_setup.result

publish_msg p is p's distribution publication message.

Test

Build

Clean

Distribution

val distrib_archive : t -> keep_dir:bool -> ( Fpath.t, Bos_setup.R.msg ) Bos_setup.result

distrib_archive p ~keep_dir creates a distribution archive for p and returns its path. If keep_dir is true the repository checkout used to create the distribution archive is kept in the build directory.

val distrib_filename : ?opam:bool -> t -> ( Fpath.t, Bos_setup.R.msg ) Bos_setup.result

distrib_filename ~opam p is a distribution filename for p. If opam is true (defaults to false), the name follows opam's naming conventions.

val publish_artefacts : t -> ( [ `Distrib | `Doc | `Alt of string ] list, Bos_setup.R.msg ) Bos_setup.result

publish_artefacts p are p's publication artefacts.

Lint

type lint = [
| `Custom
| `Std_files
| `Meta
| `Opam
| `Deps
]

The type for lints.

val lint_all : lint list

lint_all is a list with all lint values.

val lint : ?ignore_pkg:bool -> t -> dir:Fpath.t -> lint list -> ( int, Bos_setup.R.msg ) Bos_setup.result

distrib ~ignore_pkg p ~dir lints performs the lints mentioned in lints in a directory dir on the package p. If ignore_pkg is true p's definitions are ignored.