aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-09-10 13:52:17 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-09-12 20:29:24 +0300
commit540c928e3009040a520459d2993a9dfa021c1a1a (patch)
treea3b459bc47b169155101fe59478f3630426968c1
parentb04c4fa878d9a1fc3ca9f7b6e4c613735d871476 (diff)
downloadmeson-540c928e3009040a520459d2993a9dfa021c1a1a.zip
meson-540c928e3009040a520459d2993a9dfa021c1a1a.tar.gz
meson-540c928e3009040a520459d2993a9dfa021c1a1a.tar.bz2
gnome: Docbook generation for gdbus_codegen()
Add new 'docbook' argument which generates Docbook documentation for each D-Bus interface. The docbook argument will be used as prefix in `PREFIX`-NAME.xml pattern, and NAME will be replaced by the D-Bus interfaces.
-rw-r--r--docs/markdown/Gnome-module.md4
-rw-r--r--mesonbuild/modules/gnome.py5
-rw-r--r--test cases/frameworks/7 gnome/gdbus/meson.build3
3 files changed, 9 insertions, 3 deletions
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md
index 3672761..99a9c8e 100644
--- a/docs/markdown/Gnome-module.md
+++ b/docs/markdown/Gnome-module.md
@@ -226,6 +226,7 @@ files and the second specifies the XML file name.
* `namespace`: namespace of the interface
* `object_manager`: *(Added 0.40.0)* if true generates object manager code
* `annotations`: *(Added 0.43.0)* list of lists of 3 strings for the annotation for `'ELEMENT', 'KEY', 'VALUE'`
+* `docbook`: *(Added 0.43.0)* prefix to generate `'PREFIX'-NAME.xml` docbooks
Returns an opaque object containing the source files. Add it to a top
level target's source list.
@@ -241,7 +242,8 @@ gdbus_src = gnome.gdbus_codegen('example-interface', 'com.example.Sample.xml',
namespace : 'Sample',
annotations : [
['com.example.Hello()', 'org.freedesktop.DBus.Deprecated', 'true']
- ]
+ ],
+ docbook : 'example-interface-doc'
)
```
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index cb8f560..476f80b 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -850,7 +850,8 @@ class GnomeModule(ExtensionModule):
return []
- @permittedKwargs({'interface_prefix', 'namespace', 'object_manager', 'build_by_default', 'annotations'})
+ @permittedKwargs({'interface_prefix', 'namespace', 'object_manager', 'build_by_default',
+ 'annotations', 'docbook'})
def gdbus_codegen(self, state, args, kwargs):
if len(args) != 2:
raise MesonException('Gdbus_codegen takes two arguments, name and xml file.')
@@ -864,6 +865,8 @@ class GnomeModule(ExtensionModule):
cmd += ['--c-namespace', kwargs.pop('namespace')]
if kwargs.get('object_manager', False):
cmd += ['--c-generate-object-manager']
+ if 'docbook' in kwargs:
+ cmd += ['--generate-docbook', kwargs.pop('docbook')]
# Annotations are a bit ugly in that they are a list of lists of strings...
annotations = kwargs.pop('annotations', [])
diff --git a/test cases/frameworks/7 gnome/gdbus/meson.build b/test cases/frameworks/7 gnome/gdbus/meson.build
index f8a8eba..ea91caa 100644
--- a/test cases/frameworks/7 gnome/gdbus/meson.build
+++ b/test cases/frameworks/7 gnome/gdbus/meson.build
@@ -3,7 +3,8 @@ gdbus_src = gnome.gdbus_codegen('generated-gdbus', 'com.example.Sample.xml',
namespace : 'Sample',
annotations : [
['com.example.Hello()', 'org.freedesktop.DBus.Deprecated', 'true']
- ]
+ ],
+ docbook : 'generated-gdbus-doc'
)
gdbus_exe = executable('gdbus-test', 'gdbusprog.c',