summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-01-27 20:01:43 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-01-27 23:36:15 +0200
commitd51c368415c4e04a6038b664d6ab18857531564e (patch)
tree9c3c400e36f1b758f7be2008ac79461f0687b102 /docs/markdown/snippets
parent633264984b4b2278491476a0997193ff4996b3a6 (diff)
downloadmeson-versionfromfile.tar.gz
Can read project version from a file.versionfromfile
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/versionfile.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/snippets/versionfile.md b/docs/markdown/snippets/versionfile.md
new file mode 100644
index 000000000..6071f2cfb
--- /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.