aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-03-10 16:28:57 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-03-10 18:40:27 +0200
commit5a4defadab29ace322b1457cc0598c06c73a2f5c (patch)
treee975007e9b4e24c4fdb5178f975dec3811dc6e76
parent7589471978301606e698626b13ef9b62638c4ea7 (diff)
downloadmeson-5a4defadab29ace322b1457cc0598c06c73a2f5c.zip
meson-5a4defadab29ace322b1457cc0598c06c73a2f5c.tar.gz
meson-5a4defadab29ace322b1457cc0598c06c73a2f5c.tar.bz2
Generate release notes from snippets automatically. [skip ci]
-rwxr-xr-xdocs/genrelnotes.py63
-rw-r--r--docs/markdown/Release-notes-for-0.49.0.md2
-rw-r--r--docs/markdown/Release-notes-for-0.50.0.md25
-rw-r--r--docs/sitemap.txt1
4 files changed, 65 insertions, 26 deletions
diff --git a/docs/genrelnotes.py b/docs/genrelnotes.py
new file mode 100755
index 0000000..e5ff432
--- /dev/null
+++ b/docs/genrelnotes.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python3
+
+# Copyright 2019 The Meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys, os, subprocess
+from glob import glob
+
+relnote_template = '''---
+title: Release %s
+short-description: Release notes for %s
+...
+
+# New features
+
+'''
+
+
+def add_to_sitemap(from_version, to_version):
+ sitemapfile = '../sitemap.txt'
+ sf = open(sitemapfile)
+ lines = sf.readlines()
+ sf.close()
+ with open(sitemapfile, 'w') as sf:
+ for line in lines:
+ if 'Release-notes' in line and from_version in line:
+ new_line = line.replace(from_version, to_version)
+ sf.write(new_line)
+ sf.write(line)
+
+def generate(from_version, to_version):
+ ofilename = 'Release-notes-for-%s.md' % to_version
+ with open(ofilename, 'w') as ofile:
+ ofile.write(relnote_template % (to_version, to_version))
+ for snippetfile in glob('snippets/*.md'):
+ snippet = open(snippetfile).read()
+ ofile.write(snippet)
+ if not snippet.endswith('\n'):
+ ofile.write('\n')
+ ofile.write('\n')
+ subprocess.check_call(['git', 'rm', snippetfile])
+ subprocess.check_call(['git', 'add', ofilename])
+ add_to_sitemap(from_version, to_version)
+
+if __name__ == '__main__':
+ if len(sys.argv) != 3:
+ print(sys.argv[0], 'from_version to_version')
+ sys.exit(1)
+ from_version = sys.argv[1]
+ to_version = sys.argv[2]
+ os.chdir('markdown')
+ generate(from_version, to_version)
diff --git a/docs/markdown/Release-notes-for-0.49.0.md b/docs/markdown/Release-notes-for-0.49.0.md
index 4ed4be2..9889a39 100644
--- a/docs/markdown/Release-notes-for-0.49.0.md
+++ b/docs/markdown/Release-notes-for-0.49.0.md
@@ -3,6 +3,8 @@ title: Release 0.49
short-description: Release notes for 0.49
...
+# New features
+
## Libgcrypt dependency now supports libgcrypt-config
Earlier, `dependency('libgcrypt')` could only detect the library with pkg-config
diff --git a/docs/markdown/Release-notes-for-0.50.0.md b/docs/markdown/Release-notes-for-0.50.0.md
deleted file mode 100644
index a08edfb..0000000
--- a/docs/markdown/Release-notes-for-0.50.0.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: Release 0.50
-short-description: Release notes for 0.49 (preliminary)
-...
-
-# New features
-
-This page is a placeholder for the eventual release notes.
-
-Notable new features should come with release note updates. This is
-done by creating a file snippet called `snippets/featurename.md` and
-whose contents should look like this:
-
- ## Feature name
-
- A short description explaining the new feature and how it should be used.
-
-## custom_target: install no longer overrides build_by_default
-
-Earlier, if `build_by_default` was set to false and `install` was set to true in
-a `custom_target`, `install` would override it and the `custom_target` would
-always be built by default.
-Now if `build_by_default` is explicitly set to false it will no longer be
-overridden. If `build_by_default` is not set, its default will still be
-determined by the value of `install` for greater backward compatibility.
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
index bea2a31..e05e2bf 100644
--- a/docs/sitemap.txt
+++ b/docs/sitemap.txt
@@ -73,7 +73,6 @@ index.md
Shipping-prebuilt-binaries-as-wraps.md
fallback-wraptool.md
Release-notes.md
- Release-notes-for-0.50.0.md
Release-notes-for-0.49.0.md
Release-notes-for-0.48.0.md
Release-notes-for-0.47.0.md