aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-01-27 20:01:43 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-01-29 16:42:59 +0000
commit3f0a0c1582f55e0da950a7a321d25ffcf240ec6f (patch)
tree4edcd8f7cfd1e2f40be8253999a6204d3dac470e /docs
parent9eb8b6be2874b343ffa1819a3afc2d4ed355b050 (diff)
downloadmeson-3f0a0c1582f55e0da950a7a321d25ffcf240ec6f.zip
meson-3f0a0c1582f55e0da950a7a321d25ffcf240ec6f.tar.gz
meson-3f0a0c1582f55e0da950a7a321d25ffcf240ec6f.tar.bz2
Can read project version from a file.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Reference-manual.md4
-rw-r--r--docs/markdown/snippets/versionfile.md12
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 3970d6d..3a844da 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1432,7 +1432,9 @@ Project supports the following keyword arguments.
- `version`: which is a free form string describing the version of
this project. You can access the value in your Meson build files
- with `meson.project_version()`.
+ with `meson.project_version()`. Since 0.57.0 this can also be a
+ `File` object pointing to a file that contains exactly one line of
+ text.
### run_command()
diff --git a/docs/markdown/snippets/versionfile.md b/docs/markdown/snippets/versionfile.md
new file mode 100644
index 0000000..6071f2c
--- /dev/null
+++ b/docs/markdown/snippets/versionfile.md
@@ -0,0 +1,12 @@
+## Project version can be specified with a file
+
+Meson can be instructed to load project's version string from an
+external file like this:
+
+```meson
+project('foo', 'c' version: files('VERSION'))
+```
+
+The version file must contain exactly one line of text and that will
+be set as the project's version. If the line ends in a newline
+character, it is removed.