jbuilder-subst(1)               Jbuilder Manual              jbuilder-subst(1)

       jbuilder-subst - Substitute watermarks in source files.

       jbuilder subst [OPTION]...

       Substitute %%ID%% strings in source files, in a similar fashion to what
       topkg does in the default configuration.

       This command is only meant to be called when a user pins a package to
       its development version. Especially it replaces %%VERSION%% strings by
       the version obtained from the vcs. Currently only git is supported and
       the version is obtained from the output of:

         $ git describe --always --dirty

       jbuilder subst substitutes the variables that topkg substitutes with
       the defatult configuration:
       - %%NAME%%, the name of the package
       - %%VERSION%%, output of git describe --always --dirty
       - %%VERSION_NUM%%, same as %%VERSION%% but with a potential leading 'v'
       or 'V' dropped
       - %%VCS_COMMIT_ID%%, commit hash from the vcs
       - %%PKG_MAINTAINER%%, contents of the maintainer: field from the opam
       - %%PKG_AUTHORS%%, contents of the authors: field from the opam file
       - %%PKG_HOMEPAGE%%, contents of the homepage: field from the opam file
       - %%PKG_ISSUES%%, contents of the issues: field from the opam file
       - %%PKG_DOC%%, contents of the doc: field from the opam file
       - %%PKG_LICENSE%%, contents of the license: field from the opam file
       - %%PKG_REPO%%, contents of the repo: field from the opam file

       It is not possible to customize this list. If you wish to do so you
       need to configure topkg instead and use it to perform the substitution.

       Note that the expansion of %%NAME%% is guessed using the following
       heuristic: if all the <package>.opam files in the current directory are
       prefixed by the shortest package name, this prefix is used. Otherwise
       you must specify a name with the -n command line option.

       In order to call jbuilder subst when your package is pinned, add this
       line to the build: field of your opam file:

         ["jbuilder" "subst"] {pinned}

       -f, --force
           Force actions associated to aliases to be re-executed even if their
           dependencies haven't changed.

       --help[=FMT] (default=auto)
           Show this help in format FMT. The value FMT must be one of `auto',
           `pager', `groff' or `plain'. With `auto', the format is `pager` or
           `plain' whenever the TERM env var is `dumb' or undefined.

       -n NAME, --name=NAME
           Use this package name instead of detecting it.

           Show version information.

       These options are common to all commands.

           Automatically promote files. This is similar to running jbuilder
           promote after the build.

           Load this configuration file instead of the default one.

           Always print exception backtraces.

           In case of error, print the dependency path from the targets on the
           command line to the rule that failed.

           Debug the findlib sub-system.

           Use stricter compilation flags by default.

           Shell command to use to diff files

           Control the display mode of Jbuilder. See dune-config(5) for more

           Ignore rules with (mode promote)

       -j JOBS
           Run no more than JOBS commands simultaneously.

           Do not buffer the output of commands executed by jbuilder. By
           default jbuilder buffers the output of subcommands, in order to
           prevent interleaving when multiple commands are executed in
           parallel. However, this can be an issue when debugging long running
           tests. With --no-buffer, commands have direct access to the
           terminal. Note that as a result their output won't be captured in
           the log file. You should use this option in conjunction with -j 1,
           to avoid interleaving. Additionally you should use --verbose as
           well, to make sure that commands are printed before they are being

           Do not load the configuration file

           Ignore stanzas referring to a package that is not in PACKAGES.
           PACKAGES is a comma-separated list of package names. Note that this
           has the same effect as deleting the relevant stanzas from jbuild
           files. It is mostly meant for releases. During development, it is
           likely that what you want instead is to build a particular
           <package>.install target.

       -p PACKAGES, --for-release-of-packages=PACKAGES
           Shorthand for --root . --only-packages PACKAGE --promote ignore
           --no-config. You must use this option in your <package>.opam files,
           in order to build only what's necessary when your project contains
           multiple packages as well as getting reproducible builds.

           Use this directory as workspace root instead of guessing it. Note
           that this option doesn't change the interpretation of targets given
           on the command line. It is only intended for scripts.

           Same as --display verbose

           Use this specific workspace file instead of looking it up.

       -x VAL
           Cross-compile using this toolchain.

       Use `jbuilder COMMAND --help' for help on a single command.

       Check bug reports at https://github.com/ocaml/dune/issues

Jbuilder 11VERSION11                                         jbuilder-subst(1)