Skip to content

Commit

Permalink
doc: add an example for variable name :version (#10760)
Browse files Browse the repository at this point in the history
Fixes #10758

Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon authored Jul 22, 2024
1 parent 84ec349 commit 7ed503b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doc/howto/opam-file-generation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ General Notes and Tips
keep the corresponding opam fields in a ``pkg.opam.template`` file. See
:doc:`../reference/packages`.
- It is not necessary to specify ``(version)``, this will be added at release
time if you use `dune-release`_.

.. _dune-release: https://github.com/tarides/dune-release
time if you use `dune-release <https://github.com/tarides/dune-release>`_.
- To generate an opam variable such as ``version``, use a colon ``:`` followed
by the name of the variable. For example, to generate ``a { = version }`` in
the opam file, use ``(a (= :version))`` in ``dune-project``.

Generating Opam Files
---------------------
Expand All @@ -130,3 +131,11 @@ If you only want to generate the opam file, run ``dune build <project_name>.opam

Run ``dune build`` once and observe that the opam files have been created or
updated. Make sure to add these changes to your version control system.

.. seealso::

:token:`~pkg-dep:dep_specification`
How ``(depends)`` and similar fields are processed.

:doc:`/explanation/opam-integration`
How ``with-test`` and related variables are used by opam.

0 comments on commit 7ed503b

Please sign in to comment.