type watermark = string * [ `String of string | `Version | `Version_num | `Name | `Vcs of [ `Commit_id ] | `Opam of Fpath.t option * string * string ]
The type for watermarks. A watermark identifier, e.g.
"ID" and its definition:
sis the definition.
`Name, is the name of package.
`Version, is the version of the distribution.
`Version_num, is the version of the distribution with a potential leading
`Vcs `Commit_id, is the commit identifier (hash) of the distribution. May be post-fixed by
"dirty"in dev package (
`Opam (file, field, sep), is the values of the field
fieldconcatenated with separator
sepof the opam file
file, expressed relative to the distribution root directory, if
Nonethis is the package's default opam file, see
describe. Not all fields are supported see the value of
When a file is watermarked with an identifier
"ID", any occurence of the sequence
%%ID%% in its content is substituted by its definition.
val v : ?watermarks:watermark list -> ?files_to_watermark: ( unit -> ( Fpath.t list, Rresult.R.msg ) Rresult.result ) -> ?massage:( unit -> ( unit, Rresult.R.msg ) Rresult.result ) -> ?exclude_paths:( unit -> ( Fpath.t list, Rresult.R.msg ) Rresult.result ) -> unit -> t
distrib ~watermarks ~files_to_watermark ~massage
~exclude_paths () influences the distribution creation process performed by the
dune-release tool. See the full details about distribution creation.
In the following the distribution build directory is a private clone of the package's source repository's
dune-release distrib is invoked.
watermarksdefines the source watermarks for the distribution, defaults to
files_to_watermarkis invoked in the distribution build directory to determine the files to watermark, defaults to
massageis invoked in the distribution build directory, after watermarking, but before archiving. It can be used to generate distribution time build artefacts. Defaults to
exclude_paths ()is invoked in the distribution build directory, after massaging, to determine the paths that are excluded from being added to the distribution archive. Defaults to
val default_watermarks : watermark list
default_watermarks is the default list of watermarks. It has the following elements:
("VCS_COMMIT_ID", `Vcs [`Commit_id])
("PKG_MAINTAINER", `Opam (None, "maintainer", ", "))
("PKG_AUTHORS", `Opam (None, "authors", ", ")
("PKG_HOMEPAGE", `Opam (None, "homepage", " ")
("PKG_ISSUES", `Opam (None, "bug-reports", " ")
("PKG_DOC", `Opam (None, "doc", " "))
("PKG_LICENSE", `Opam (None, "license", ", ")
("PKG_REPO", `Opam (None, "dev-repo", " "))
Prepending to the list overrides default definitions.
default_files_to_watermark () is the default list of files to watermark. It is invoked in the distribution build directory and gets the set of tracked files of this directory from which it removes the files that end with
default_massage is the default distribution massaging function. It is invoked in the distribution build directory and does nothing.
default_exclude_paths () is the default list of paths to exclude from the distribution archive. It is invoked in the distribution build directory and returns the following static set of files.
fun () -> Ok [".git"; ".gitignore"; ".gitattributes"; ".hg"; ".hgignore"; "build"; "Makefile"; "_build"]