diff options
author | Federico Mena Quintero <federico@gnome.org> | 2022-12-12 16:43:48 -0600 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2022-12-12 16:47:54 -0600 |
commit | 7a0c7f420dca9793c5bb44e0406de3eb5d682284 (patch) | |
tree | 4bb4803c653775f221204145f184fd1323dac1d5 | |
parent | bd2417283454427570cc70623e90a924d03b46c4 (diff) | |
download | at-spi2-core-7a0c7f420dca9793c5bb44e0406de3eb5d682284.tar.gz |
Build the devel-docs as part of the meson build
Also, generate pages based on the documentation for the XML
interfaces.
It's easier to have this in meson, rather than an independent script,
since now the final document depends on various things: the rst
sources themselves, plus the rst docs extracted from the XML interface
files.
-rw-r--r-- | devel-docs/meson.build | 42 | ||||
-rw-r--r-- | meson.build | 2 |
2 files changed, 44 insertions, 0 deletions
diff --git a/devel-docs/meson.build b/devel-docs/meson.build new file mode 100644 index 00000000..d8978fcc --- /dev/null +++ b/devel-docs/meson.build @@ -0,0 +1,42 @@ +gdbus_codegen = find_program('gdbus-codegen', + native: true, + required: get_option('docs')) + +sphinx_build = find_program('sphinx-build', + native: true, + required: get_option('docs')) + +interfaces_rst_sources = [] +interfaces_xml = [] + +foreach i: introspection_sources + # /foo/bar/baz.xml -> doc-baz.rst + doc_name = 'doc-' + fs.replace_suffix(fs.name(i), '.rst') + interfaces_rst_sources += doc_name + + interfaces_xml += join_paths(meson.project_source_root(), 'xml', i) +endforeach + +interfaces_rst = custom_target( + 'interfaces_rst', + input: interfaces_xml, + output: interfaces_rst_sources, + command: [ gdbus_codegen, '--generate-rst', 'doc', '@INPUT@'] +) + +docs_sources = [ + 'atk-deprecations.rst', + 'de-controller.rst', + 'gitlab-ci.rst', + 'index.rst', + 'roadmap.rst', + 'toolkits.rst', + 'xml-changes.rst', +] + +custom_target( + 'devel_docs', + input: docs_sources + interfaces_rst, + output: 'devel-docs', + command: [ sphinx_build, meson.current_source_dir(), '@OUTPUT@' ], +) diff --git a/meson.build b/meson.build index 1719a096..b386aa29 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,8 @@ project('at-spi2-core', 'c', add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE' ], language: 'c') +fs = import('fs') + atspi_gir_ns = 'Atspi' cc = meson.get_compiler('c') |