.\" Pipe this output to groff -Tutf8 | less .\" .mso an.tmac .TH "jbuilder-subst" 1 "" "Jbuilder 1.0+beta20" "Jbuilder Manual" .\" Disable hyphenation and ragged-right .nh .ad l .SH NAME .P jbuilder\N'45'subst \N'45' Substitute watermarks in source files\N'46' .SH SYNOPSIS .P \fBjbuilder subst\fR [\fIOPTION\fR]\N'46'\N'46'\N'46' .SH DESCRIPTION .P Substitute \fB%%ID%%\fR strings in source files, in a similar fashion to what topkg does in the default configuration\N'46' .P This command is only meant to be called when a user pins a package to its development version\N'46' Especially it replaces \fB1\N'46'0+beta20\fR strings by the version obtained from the vcs\N'46' Currently only git is supported and the version is obtained from the output of: .P .nf $ git describe \N'45'\N'45'always \N'45'\N'45'dirty .fi .P \fBjbuilder subst\fR substitutes the variables that topkg substitutes with the defatult configuration: .sp -1 .P \N'45' \fB%%NAME%%\fR, the name of the package .sp -1 .P \N'45' \fB%%VERSION%%\fR, output of \fBgit describe \N'45'\N'45'always \N'45'\N'45'dirty\fR .sp -1 .P \N'45' \fB%%VERSION_NUM%%\fR, same as \fB1\N'46'0+beta20\fR but with a potential leading \N'39'v\N'39' or \N'39'V\N'39' dropped .sp -1 .P \N'45' \fB%%VCS_COMMIT_ID%%\fR, commit hash from the vcs .sp -1 .P \N'45' \fB%%PKG_MAINTAINER%%\fR, contents of the \fBmaintainer:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_AUTHORS%%\fR, contents of the \fBauthors:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_HOMEPAGE%%\fR, contents of the \fBhomepage:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_ISSUES%%\fR, contents of the \fBissues:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_DOC%%\fR, contents of the \fBdoc:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_LICENSE%%\fR, contents of the \fBlicense:\fR field from the opam file .sp -1 .P \N'45' \fB%%PKG_REPO%%\fR, contents of the \fBrepo:\fR field from the opam file .P It is not possible to customize this list\N'46' If you wish to do so you need to configure topkg instead and use it to perform the substitution\N'46' .P Note that the expansion of \fBjbuilder\fR is guessed using the following heuristic: if all the \fB\N'46'opam\fR files in the current directory are prefixed by the shortest package name, this prefix is used\N'46' Otherwise you must specify a name with the \fB\N'45'n\fR command line option\N'46' .P In order to call \fBjbuilder subst\fR when your package is pinned, add this line to the \fBbuild:\fR field of your opam file: .P .nf ["jbuilder" "subst"] {pinned} .fi .SH OPTIONS .TP 4 \fB\N'45'f\fR, \fB\N'45'\N'45'force\fR Force actions associated to aliases to be re\N'45'executed even if their dependencies haven\N'39't changed\N'46' .TP 4 \fB\N'45'\N'45'help\fR[=\fIFMT\fR] (default=auto) Show this help in format \fIFMT\fR\N'46' The value \fIFMT\fR must be one of `auto\N'39', `pager\N'39', `groff\N'39' or `plain\N'39'\N'46' With `auto\N'39', the format is `pager` or `plain\N'39' whenever the \fBTERM\fR env var is `dumb\N'39' or undefined\N'46' .TP 4 \fB\N'45'n\fR \fINAME\fR, \fB\N'45'\N'45'name\fR=\fINAME\fR Use this package name instead of detecting it\N'46' .TP 4 \fB\N'45'\N'45'version\fR Show version information\N'46' .SH COMMON OPTIONS .P These options are common to all commands\N'46' .TP 4 \fB\N'45'\N'45'auto\N'45'promote\fR Automatically promote files\N'46' This is similar to running \fBjbuilder promote\fR after the build\N'46' .TP 4 \fB\N'45'\N'45'config\N'45'file\fR=\fIFILE\fR Load this configuration file instead of the default one\N'46' .TP 4 \fB\N'45'\N'45'debug\N'45'backtraces\fR Always print exception backtraces\N'46' .TP 4 \fB\N'45'\N'45'debug\N'45'dependency\N'45'path\fR In case of error, print the dependency path from the targets on the command line to the rule that failed\N'46' .TP 4 \fB\N'45'\N'45'debug\N'45'findlib\fR Debug the findlib sub\N'45'system\N'46' .TP 4 \fB\N'45'\N'45'dev\fR Use stricter compilation flags by default\N'46' .TP 4 \fB\N'45'\N'45'diff\N'45'command\fR=\fIVAL\fR Shell command to use to diff files .TP 4 \fB\N'45'\N'45'display\fR=\fIMODE\fR Control the display mode of Jbuilder\N'46' See \fBdune\N'45'config(5)\fR for more details\N'46' .TP 4 \fB\N'45'\N'45'ignore\N'45'promoted\N'45'rules\fR Ignore rules with (mode promote) .TP 4 \fB\N'45'j\fR \fIJOBS\fR Run no more than \fIJOBS\fR commands simultaneously\N'46' .TP 4 \fB\N'45'\N'45'no\N'45'buffer\fR Do not buffer the output of commands executed by jbuilder\N'46' By default jbuilder buffers the output of subcommands, in order to prevent interleaving when multiple commands are executed in parallel\N'46' However, this can be an issue when debugging long running tests\N'46' With \fB\N'45'\N'45'no\N'45'buffer\fR, commands have direct access to the terminal\N'46' Note that as a result their output won\N'39't be captured in the log file\N'46' You should use this option in conjunction with \fB\N'45'j 1\fR, to avoid interleaving\N'46' Additionally you should use \fB\N'45'\N'45'verbose\fR as well, to make sure that commands are printed before they are being executed\N'46' .TP 4 \fB\N'45'\N'45'no\N'45'config\fR Do not load the configuration file .TP 4 \fB\N'45'\N'45'only\N'45'packages\fR=\fIPACKAGES\fR Ignore stanzas referring to a package that is not in \fBPACKAGES\fR\N'46' \fBPACKAGES\fR is a comma\N'45'separated list of package names\N'46' Note that this has the same effect as deleting the relevant stanzas from jbuild files\N'46' It is mostly meant for releases\N'46' During development, it is likely that what you want instead is to build a particular \fB\N'46'install\fR target\N'46' .TP 4 \fB\N'45'p\fR \fIPACKAGES\fR, \fB\N'45'\N'45'for\N'45'release\N'45'of\N'45'packages\fR=\fIPACKAGES\fR Shorthand for \fB\N'45'\N'45'root \N'46' \N'45'\N'45'only\N'45'packages PACKAGE \N'45'\N'45'promote ignore \N'45'\N'45'no\N'45'config\fR\N'46' You must use this option in your \fI\N'46'opam\fR files, in order to build only what\N'39's necessary when your project contains multiple packages as well as getting reproducible builds\N'46' .TP 4 \fB\N'45'\N'45'root\fR=\fIDIR\fR Use this directory as workspace root instead of guessing it\N'46' Note that this option doesn\N'39't change the interpretation of targets given on the command line\N'46' It is only intended for scripts\N'46' .TP 4 \fB\N'45'\N'45'verbose\fR Same as \fB\N'45'\N'45'display verbose\fR .TP 4 \fB\N'45'\N'45'workspace\fR=\fIFILE\fR Use this specific workspace file instead of looking it up\N'46' .TP 4 \fB\N'45'x\fR \fIVAL\fR Cross\N'45'compile using this toolchain\N'46' .SH MORE HELP .P Use `\fBjbuilder\fR \fICOMMAND\fR \N'45'\N'45'help\N'39' for help on a single command\N'46' .SH BUGS .P Check bug reports at https://github\N'46'com/ocaml/dune/issues