generate_opam_files¶
- (generate_opam_files ...)
Added in version 1.10.
Use metadata specified in the
dune-project
file to generate.opam
files.To enable this integration, add the following field to the
dune-project
file:(generate_opam_files)
Dune uses the following global fields to set the metadata for all packages defined in the project:
- (license <strings>)
Added in version 1.9.
Specify the license of the project, ideally as an identifier from the SPDX License List.
Example:
(license MIT)
Multiple licenses may be specified.
- (authors <strings>)
Added in version 1.9.
Specify authors.
Example:
(authors "Jane Doe <jane.doe@example.com>" "John Doe <john.doe@example.com>")
- (maintainers <strings>)
Added in version 1.10.
Specify maintainers.
Example:
(maintainers "Jane Doe <jane.doe@example.com>" "John Doe <john.doe@example.com>")
- (source ...)
Added in version 1.7.
Specify where the source for the package can be found.
It can be specified as
(uri <uri>)
or using shortcuts for some hosting services:Service
Syntax
(github user/repo)
(bitbucket user/repo)
(gitlab user/repo)
(gitlab organization/project/repo)
(New in 3.17)(sourcehut user/repo)
(codeberg user/repo)
(New in 3.17)Examples:
(source (github ocaml/dune))
(source (uri https://dev.example.com/project.git))
- (bug_reports <url>)
Added in version 1.10.
Where bugs should be reported.
If a hosting service is used in
(source)
, a default value is provided.Example:
(bug_reports https://dev.example.com/project/issues)
- (homepage <url>)
Added in version 1.10.
The homepage of the project.
If a hosting service is used in
(source)
, a default value is provided.Example:
(bug_reports https://example.com/)
- (documentation <url>)
Added in version 1.10.
Where the documentation is hosted.
With these fields, every time one calls Dune to execute some rules (either via
dune build
, dune runtest
, or something else), the opam files get
generated.
Some or all of these fields may be overridden for each package of the project, see package.