From 960ab397397a2688833fda6cf00e873624d42fd9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 28 May 2020 19:09:12 +0200 Subject: docs: rename "nm-property-docs.xml" to "nm-settings-docs-gir.xml" The name is bad. For one, we will have more files of the same format ("nm-settings-docs-nmcli.xml"). Also, "libnm/nm-settings-docs.xml" and "libnm/nm-property-docs.xml" had basically the same file format. Their name should be similar. Also the tool to generate the file should have a name that reminds to the file that it creates. --- .gitignore | 3 +- Makefile.am | 16 +- clients/common/meson.build | 2 +- libnm/generate-docs-nm-settings-docs-gir.py | 246 ++++++++++++++++++++++++++++ libnm/generate-setting-docs.py | 246 ---------------------------- libnm/meson.build | 17 +- 6 files changed, 266 insertions(+), 264 deletions(-) create mode 100755 libnm/generate-docs-nm-settings-docs-gir.py delete mode 100755 libnm/generate-setting-docs.py diff --git a/.gitignore b/.gitignore index e3c7cd895f..205a8cc1e9 100644 --- a/.gitignore +++ b/.gitignore @@ -147,10 +147,10 @@ test-*.trs /libnm-core/nm-dbus-types.xml /libnm-core/nm-vpn-dbus-types.xml -/libnm/nm-property-docs.xml /libnm/nm-property-infos-dbus.xml /libnm/nm-property-infos-ifcfg-rh.xml /libnm/nm-property-infos-keyfile.xml +/libnm/nm-settings-docs-gir.xml /libnm/nm-settings-docs.xml /libnm/tests/test-libnm /libnm/tests/test-nm-client @@ -325,6 +325,7 @@ test-*.trs /libnm/fake-typelib/typelibs.c /libnm/nm-ifcfg-rh-docs.xml /libnm/nm-keyfile-docs.xml +/libnm/nm-property-docs.xml /libnm/nm-setting-docs-overrides.xml /libnm/nm-setting-docs.xml /libnm/nm-settings-docs-overrides.xml diff --git a/Makefile.am b/Makefile.am index 78c7a30932..f6fcfc7e65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1553,10 +1553,10 @@ libnm/libnm.typelib: libnm/libnm.gir INTROSPECTION_GIRS += libnm/NM-1.0.gir libnm_noinst_data = \ - libnm/nm-property-docs.xml \ libnm/nm-property-infos-dbus.xml \ libnm/nm-property-infos-ifcfg-rh.xml \ libnm/nm-property-infos-keyfile.xml \ + libnm/nm-settings-docs-gir.xml \ libnm/nm-settings-docs.xml \ $(NULL) @@ -1567,30 +1567,28 @@ libnm_docs_sources = $(libnm_core_lib_c_settings_real) libnm/nm-property-infos-%.xml: libnm/generate-docs-nm-property-infos.pl $(libnm_docs_sources) $(AM_V_GEN) $(srcdir)/libnm/generate-docs-nm-property-infos.pl $(patsubst nm-property-infos-%.xml,%,$(notdir $@)) $@ $(filter-out $<,$^) -# When the python scripts loads libnm and the address sanitizers is -# enabled, we must LD_PRELOAD libasan otherwise it will complain that -# it was not loaded as initial library. -libnm/nm-property-docs.xml: libnm/generate-setting-docs.py $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la +libnm/nm-settings-docs-gir.xml: libnm/generate-docs-nm-settings-docs-gir.py libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la $(libnm_docs_sources) $(AM_V_GEN) \ export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ $(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so); \ "$(PYTHON)" \ - $(srcdir)/libnm/generate-setting-docs.py \ + $(srcdir)/libnm/generate-docs-nm-settings-docs-gir.py \ --gir $(builddir)/libnm/NM-1.0.gir \ --output $@ -libnm/nm-settings-docs.xml: libnm/nm-property-infos-dbus.xml libnm/nm-property-docs.xml libnm/generate-docs-nm-settings-docs-merge.py +libnm/nm-settings-docs.xml: libnm/nm-property-infos-dbus.xml libnm/nm-settings-docs-gir.xml libnm/generate-docs-nm-settings-docs-merge.py $(AM_V_GEN) "$(PYTHON)" $(srcdir)/libnm/generate-docs-nm-settings-docs-merge.py $@ $(wordlist 1,2,$^) EXTRA_DIST += $(libnm_noinst_data) +DISTCLEANFILES += $(libnm_noinst_data) endif EXTRA_DIST += \ libnm/generate-docs-nm-property-infos.pl \ libnm/generate-docs-nm-settings-docs-merge.py \ - libnm/generate-setting-docs.py \ + libnm/generate-docs-nm-settings-docs-gir.py \ libnm/meson.build \ libnm/nm-enum-types.c.template \ libnm/nm-enum-types.h.template \ @@ -4366,7 +4364,7 @@ $(clients_common_libnmc_base_la_OBJECTS): clients/common/.dirstamp clients_common_settings_doc_h = clients/common/settings-docs.h if HAVE_INTROSPECTION -$(clients_common_settings_doc_h): clients/common/settings-docs.xsl libnm/nm-property-docs.xml clients/common/.dirstamp +$(clients_common_settings_doc_h): clients/common/settings-docs.xsl libnm/nm-settings-docs-gir.xml clients/common/.dirstamp $(AM_V_GEN) $(XSLTPROC) --output $@ $< $(word 2,$^) DISTCLEANFILES += $(clients_common_settings_doc_h) check-local-settings-docs: $(clients_common_settings_doc_h) diff --git a/clients/common/meson.build b/clients/common/meson.build index c32bb5e7cc..95cf04d078 100644 --- a/clients/common/meson.build +++ b/clients/common/meson.build @@ -34,7 +34,7 @@ settings_docs = 'settings-docs.h' if enable_introspection settings_docs_source = custom_target( settings_docs, - input: nm_property_docs, + input: nm_settings_docs_xml['gir'], output: settings_docs, command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@'], ) diff --git a/libnm/generate-docs-nm-settings-docs-gir.py b/libnm/generate-docs-nm-settings-docs-gir.py new file mode 100755 index 0000000000..f63c48b1ae --- /dev/null +++ b/libnm/generate-docs-nm-settings-docs-gir.py @@ -0,0 +1,246 @@ +#!/usr/bin/env python +# SPDX-License-Identifier: LGPL-2.1+ +# +# Copyright (C) 2009 - 2017 Red Hat, Inc. +# + +from __future__ import print_function + +import os +import gi +gi.require_version('GIRepository', '2.0') +from gi.repository import GIRepository +import argparse, re, sys +import xml.etree.ElementTree as ET + +try: + libs = os.environ['LD_LIBRARY_PATH'].split(':') + libs.reverse() + for lib in libs: + GIRepository.Repository.prepend_library_path(lib) +except AttributeError: + # An old GI version, that has no prepend_library_path + # It's alright, it probably interprets LD_LIBRARY_PATH + # correctly. + pass +except KeyError: + pass + +gi.require_version('NM', '1.0') +from gi.repository import NM, GObject + +dbus_type_name_map = { + 'b': 'boolean', + 's': 'string', + 'i': 'int32', + 'u': 'uint32', + 't': 'uint64', + 'x': 'int64', + 'y': 'byte', + 'as': 'array of string', + 'au': 'array of uint32', + 'ay': 'byte array', + 'a{ss}': 'dict of string to string', + 'a{sv}': 'vardict', + 'aa{sv}': 'array of vardict', + 'aau': 'array of array of uint32', + 'aay': 'array of byte array', + 'a(ayuay)': 'array of legacy IPv6 address struct', + 'a(ayuayu)': 'array of legacy IPv6 route struct', +} + +ns_map = { + 'c': 'http://www.gtk.org/introspection/c/1.0', + 'gi': 'http://www.gtk.org/introspection/core/1.0', + 'glib': 'http://www.gtk.org/introspection/glib/1.0' +} +identifier_key = '{%s}identifier' % ns_map['c'] +nick_key = '{%s}nick' % ns_map['glib'] +symbol_prefix_key = '{%s}symbol-prefix' % ns_map['c'] + +constants = { + 'TRUE': 'TRUE', + 'FALSE': 'FALSE', + 'G_MAXUINT32': 'G_MAXUINT32', + 'NULL': 'NULL' } +setting_names = {} + +def get_setting_name_define(setting): + n = setting.attrib[symbol_prefix_key] + if n and n.startswith("setting_"): + return n[8:].upper() + raise Exception("Unexpected symbol_prefix_key \"%s\"" % (n)) + +def init_constants(girxml, settings): + for const in girxml.findall('./gi:namespace/gi:constant', ns_map): + cname = const.attrib['{%s}type' % ns_map['c']] + cvalue = const.attrib['value'] + if const.find('./gi:type[@name="utf8"]', ns_map) is not None: + cvalue = '"%s"' % cvalue + constants[cname] = cvalue + + for enum in girxml.findall('./gi:namespace/gi:enumeration', ns_map): + for enumval in enum.findall('./gi:member', ns_map): + cname = enumval.attrib[identifier_key] + cvalue = '%s (%s)' % (cname, enumval.attrib['value']) + constants[cname] = cvalue + + for enum in girxml.findall('./gi:namespace/gi:bitfield', ns_map): + for enumval in enum.findall('./gi:member', ns_map): + cname = enumval.attrib[identifier_key] + cvalue = '%s (0x%x)' % (cname, int(enumval.attrib['value'])) + constants[cname] = cvalue + + for setting in settings: + setting_type_name = 'NM' + setting.attrib['name']; + setting_name_symbol = 'NM_SETTING_' + get_setting_name_define(setting) + '_SETTING_NAME' + if setting_name_symbol in constants: + setting_name = constants[setting_name_symbol] + setting_names[setting_type_name] = setting_name + +def get_prop_type(setting, pspec): + dbus_type = setting.get_dbus_property_type(pspec.name).dup_string() + prop_type = dbus_type_name_map[dbus_type] + + if GObject.type_is_a(pspec.value_type, GObject.TYPE_ENUM) or GObject.type_is_a(pspec.value_type, GObject.TYPE_FLAGS): + prop_type = "%s (%s)" % (pspec.value_type.name, prop_type) + + return prop_type + +def get_docs(propxml): + doc_xml = propxml.find('gi:doc', ns_map) + if doc_xml is None: + return None + + doc = doc_xml.text + if 'deprecated' in propxml.attrib: + doc = doc + ' Deprecated: ' + propxml.attrib['deprecated'] + + doc = re.sub(r'\n\s*', r' ', doc) + + # Expand constants + doc = re.sub(r'%([^%]\w*)', lambda match: constants[match.group(1)], doc) + + # #NMSettingWired:mac-address -> "mac-address" + doc = re.sub(r'#[A-Za-z0-9_]*:([A-Za-z0-9_-]*)', r'"\1"', doc) + + # #NMSettingWired setting -> "802-3-ethernet" setting + doc = re.sub(r'#([A-Z]\w*) setting', lambda match: setting_names[match.group(1)] + ' setting', doc) + + # remaining gtk-doc cleanup + doc = doc.replace('%%', '%') + doc = doc.replace('', '') + doc = re.sub(r' Element-.ype:.*', '', doc) + doc = re.sub(r'#([A-Z]\w*)', r'\1', doc) + + # Remove sentences that refer to functions + doc = re.sub(r'\.\s+[^.]*\w\(\)[^.]*\.', r'.', doc) + + return doc + +def get_default_value(setting, pspec, propxml): + default_value = setting.get_property(pspec.name.replace('-', '_')) + if default_value is None: + return default_value + + value_type = get_prop_type(setting, pspec) + if value_type == 'string' and default_value != '' and pspec.name != 'name': + default_value = '"%s"' % default_value + elif value_type == 'boolean': + default_value = str(default_value).upper() + elif value_type == 'byte array': + default_value = '[]' + elif str(default_value).startswith('<'): + default_value = None + elif str(default_value).startswith('['): + default_value = None + + return default_value + +def settings_sort_key(x): + x_prefix = x.attrib['{%s}symbol-prefix' % ns_map['c']] + # always sort NMSettingConnection first + return (x_prefix != "setting_connection", x_prefix); + +def escape(val): + return str(val).replace('"', '"') + +def usage(): + print("Usage: %s --gir FILE --output FILE" % sys.argv[0]) + exit() + +parser = argparse.ArgumentParser() +parser.add_argument('-l', '--lib-path', metavar='PATH', action='append', help='path to scan for shared libraries') +parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file') +parser.add_argument('-o', '--output', metavar='FILE', help='output file') + +args = parser.parse_args() +if args.gir is None or args.output is None: + usage() + +if args.lib_path: + for lib in args.lib_path: + GIRepository.Repository.prepend_library_path(lib) + +girxml = ET.parse(args.gir).getroot() +outfile = open(args.output, mode='w') + +basexml = girxml.find('./gi:namespace/gi:class[@name="Setting"]', ns_map) +settings = girxml.findall('./gi:namespace/gi:class[@parent="Setting"]', ns_map) +# Hack. Need a better way to do this +ipxml = girxml.find('./gi:namespace/gi:class[@name="SettingIPConfig"]', ns_map) +settings.extend(girxml.findall('./gi:namespace/gi:class[@parent="SettingIPConfig"]', ns_map)) +settings = sorted(settings, key=settings_sort_key) + +init_constants(girxml, settings) + +outfile.write(""" + +]> + +""") + +for settingxml in settings: + if 'abstract' in settingxml.attrib: + continue + + new_func = NM.__getattr__(settingxml.attrib['name']) + setting = new_func() + + class_desc = get_docs(settingxml) + if class_desc is None: + raise Exception("%s needs a gtk-doc block with one-line description" % setting.props.name) + outfile.write(" \n" % (setting.props.name, class_desc, get_setting_name_define (settingxml))) + + setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) if prop.name != 'name' } + + for prop in sorted(setting_properties): + pspec = setting_properties[prop] + + propxml = settingxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) + if propxml is None: + propxml = basexml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) + if propxml is None: + propxml = ipxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) + + value_type = get_prop_type(setting, pspec) + value_desc = get_docs(propxml) + default_value = get_default_value(setting, pspec, propxml) + + prop_upper = prop.upper().replace('-', '_') + + if value_desc is None: + raise Exception("%s.%s needs a documentation description" % (setting.props.name, prop)) + + default_value_as_xml = '' + if default_value is not None: + default_value_as_xml = (' default=\"%s\"' % (escape(default_value))) + + outfile.write(" \n" % + (prop, prop_upper, value_type, default_value_as_xml, escape(value_desc))) + + outfile.write(" \n") + +outfile.write("\n") +outfile.close() diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py deleted file mode 100755 index f63c48b1ae..0000000000 --- a/libnm/generate-setting-docs.py +++ /dev/null @@ -1,246 +0,0 @@ -#!/usr/bin/env python -# SPDX-License-Identifier: LGPL-2.1+ -# -# Copyright (C) 2009 - 2017 Red Hat, Inc. -# - -from __future__ import print_function - -import os -import gi -gi.require_version('GIRepository', '2.0') -from gi.repository import GIRepository -import argparse, re, sys -import xml.etree.ElementTree as ET - -try: - libs = os.environ['LD_LIBRARY_PATH'].split(':') - libs.reverse() - for lib in libs: - GIRepository.Repository.prepend_library_path(lib) -except AttributeError: - # An old GI version, that has no prepend_library_path - # It's alright, it probably interprets LD_LIBRARY_PATH - # correctly. - pass -except KeyError: - pass - -gi.require_version('NM', '1.0') -from gi.repository import NM, GObject - -dbus_type_name_map = { - 'b': 'boolean', - 's': 'string', - 'i': 'int32', - 'u': 'uint32', - 't': 'uint64', - 'x': 'int64', - 'y': 'byte', - 'as': 'array of string', - 'au': 'array of uint32', - 'ay': 'byte array', - 'a{ss}': 'dict of string to string', - 'a{sv}': 'vardict', - 'aa{sv}': 'array of vardict', - 'aau': 'array of array of uint32', - 'aay': 'array of byte array', - 'a(ayuay)': 'array of legacy IPv6 address struct', - 'a(ayuayu)': 'array of legacy IPv6 route struct', -} - -ns_map = { - 'c': 'http://www.gtk.org/introspection/c/1.0', - 'gi': 'http://www.gtk.org/introspection/core/1.0', - 'glib': 'http://www.gtk.org/introspection/glib/1.0' -} -identifier_key = '{%s}identifier' % ns_map['c'] -nick_key = '{%s}nick' % ns_map['glib'] -symbol_prefix_key = '{%s}symbol-prefix' % ns_map['c'] - -constants = { - 'TRUE': 'TRUE', - 'FALSE': 'FALSE', - 'G_MAXUINT32': 'G_MAXUINT32', - 'NULL': 'NULL' } -setting_names = {} - -def get_setting_name_define(setting): - n = setting.attrib[symbol_prefix_key] - if n and n.startswith("setting_"): - return n[8:].upper() - raise Exception("Unexpected symbol_prefix_key \"%s\"" % (n)) - -def init_constants(girxml, settings): - for const in girxml.findall('./gi:namespace/gi:constant', ns_map): - cname = const.attrib['{%s}type' % ns_map['c']] - cvalue = const.attrib['value'] - if const.find('./gi:type[@name="utf8"]', ns_map) is not None: - cvalue = '"%s"' % cvalue - constants[cname] = cvalue - - for enum in girxml.findall('./gi:namespace/gi:enumeration', ns_map): - for enumval in enum.findall('./gi:member', ns_map): - cname = enumval.attrib[identifier_key] - cvalue = '%s (%s)' % (cname, enumval.attrib['value']) - constants[cname] = cvalue - - for enum in girxml.findall('./gi:namespace/gi:bitfield', ns_map): - for enumval in enum.findall('./gi:member', ns_map): - cname = enumval.attrib[identifier_key] - cvalue = '%s (0x%x)' % (cname, int(enumval.attrib['value'])) - constants[cname] = cvalue - - for setting in settings: - setting_type_name = 'NM' + setting.attrib['name']; - setting_name_symbol = 'NM_SETTING_' + get_setting_name_define(setting) + '_SETTING_NAME' - if setting_name_symbol in constants: - setting_name = constants[setting_name_symbol] - setting_names[setting_type_name] = setting_name - -def get_prop_type(setting, pspec): - dbus_type = setting.get_dbus_property_type(pspec.name).dup_string() - prop_type = dbus_type_name_map[dbus_type] - - if GObject.type_is_a(pspec.value_type, GObject.TYPE_ENUM) or GObject.type_is_a(pspec.value_type, GObject.TYPE_FLAGS): - prop_type = "%s (%s)" % (pspec.value_type.name, prop_type) - - return prop_type - -def get_docs(propxml): - doc_xml = propxml.find('gi:doc', ns_map) - if doc_xml is None: - return None - - doc = doc_xml.text - if 'deprecated' in propxml.attrib: - doc = doc + ' Deprecated: ' + propxml.attrib['deprecated'] - - doc = re.sub(r'\n\s*', r' ', doc) - - # Expand constants - doc = re.sub(r'%([^%]\w*)', lambda match: constants[match.group(1)], doc) - - # #NMSettingWired:mac-address -> "mac-address" - doc = re.sub(r'#[A-Za-z0-9_]*:([A-Za-z0-9_-]*)', r'"\1"', doc) - - # #NMSettingWired setting -> "802-3-ethernet" setting - doc = re.sub(r'#([A-Z]\w*) setting', lambda match: setting_names[match.group(1)] + ' setting', doc) - - # remaining gtk-doc cleanup - doc = doc.replace('%%', '%') - doc = doc.replace('', '') - doc = re.sub(r' Element-.ype:.*', '', doc) - doc = re.sub(r'#([A-Z]\w*)', r'\1', doc) - - # Remove sentences that refer to functions - doc = re.sub(r'\.\s+[^.]*\w\(\)[^.]*\.', r'.', doc) - - return doc - -def get_default_value(setting, pspec, propxml): - default_value = setting.get_property(pspec.name.replace('-', '_')) - if default_value is None: - return default_value - - value_type = get_prop_type(setting, pspec) - if value_type == 'string' and default_value != '' and pspec.name != 'name': - default_value = '"%s"' % default_value - elif value_type == 'boolean': - default_value = str(default_value).upper() - elif value_type == 'byte array': - default_value = '[]' - elif str(default_value).startswith('<'): - default_value = None - elif str(default_value).startswith('['): - default_value = None - - return default_value - -def settings_sort_key(x): - x_prefix = x.attrib['{%s}symbol-prefix' % ns_map['c']] - # always sort NMSettingConnection first - return (x_prefix != "setting_connection", x_prefix); - -def escape(val): - return str(val).replace('"', '"') - -def usage(): - print("Usage: %s --gir FILE --output FILE" % sys.argv[0]) - exit() - -parser = argparse.ArgumentParser() -parser.add_argument('-l', '--lib-path', metavar='PATH', action='append', help='path to scan for shared libraries') -parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file') -parser.add_argument('-o', '--output', metavar='FILE', help='output file') - -args = parser.parse_args() -if args.gir is None or args.output is None: - usage() - -if args.lib_path: - for lib in args.lib_path: - GIRepository.Repository.prepend_library_path(lib) - -girxml = ET.parse(args.gir).getroot() -outfile = open(args.output, mode='w') - -basexml = girxml.find('./gi:namespace/gi:class[@name="Setting"]', ns_map) -settings = girxml.findall('./gi:namespace/gi:class[@parent="Setting"]', ns_map) -# Hack. Need a better way to do this -ipxml = girxml.find('./gi:namespace/gi:class[@name="SettingIPConfig"]', ns_map) -settings.extend(girxml.findall('./gi:namespace/gi:class[@parent="SettingIPConfig"]', ns_map)) -settings = sorted(settings, key=settings_sort_key) - -init_constants(girxml, settings) - -outfile.write(""" - -]> - -""") - -for settingxml in settings: - if 'abstract' in settingxml.attrib: - continue - - new_func = NM.__getattr__(settingxml.attrib['name']) - setting = new_func() - - class_desc = get_docs(settingxml) - if class_desc is None: - raise Exception("%s needs a gtk-doc block with one-line description" % setting.props.name) - outfile.write(" \n" % (setting.props.name, class_desc, get_setting_name_define (settingxml))) - - setting_properties = { prop.name: prop for prop in GObject.list_properties(setting) if prop.name != 'name' } - - for prop in sorted(setting_properties): - pspec = setting_properties[prop] - - propxml = settingxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) - if propxml is None: - propxml = basexml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) - if propxml is None: - propxml = ipxml.find('./gi:property[@name="%s"]' % pspec.name, ns_map) - - value_type = get_prop_type(setting, pspec) - value_desc = get_docs(propxml) - default_value = get_default_value(setting, pspec, propxml) - - prop_upper = prop.upper().replace('-', '_') - - if value_desc is None: - raise Exception("%s.%s needs a documentation description" % (setting.props.name, prop)) - - default_value_as_xml = '' - if default_value is not None: - default_value_as_xml = (' default=\"%s\"' % (escape(default_value))) - - outfile.write(" \n" % - (prop, prop_upper, value_type, default_value_as_xml, escape(value_desc))) - - outfile.write(" \n") - -outfile.write("\n") -outfile.close() diff --git a/libnm/meson.build b/libnm/meson.build index 66fce80c8b..b77a759640 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -273,15 +273,14 @@ if enable_introspection 'LD_LIBRARY_PATH=' + ld_library_path, ] - name = 'nm-property-docs.xml' - nm_property_docs = custom_target( - name, + nm_settings_docs_xml_gir = custom_target( + 'nm-settings-docs-gir.xml', input: libnm_gir[0], - output: name, + output: 'nm-settings-docs-gir.xml', command: [ generate_setting_docs_env, python.path(), - join_paths(meson.current_source_dir(), 'generate-setting-docs.py'), + join_paths(meson.current_source_dir(), 'generate-docs-nm-settings-docs-gir.py'), '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@' @@ -289,17 +288,21 @@ if enable_introspection depends: libnm_gir, ) + nm_settings_docs_xml = { + 'gir': nm_settings_docs_xml_gir, + } + name = 'nm-settings-docs.xml' nm_settings_docs = custom_target( name, - input: [nm_property_docs, nm_property_infos_xml['dbus']], + input: [nm_settings_docs_xml_gir, nm_property_infos_xml['dbus']], output: name, command: [ python.path(), join_paths(meson.current_source_dir(), 'generate-docs-nm-settings-docs-merge.py'), '@OUTPUT@', nm_property_infos_xml['dbus'], - nm_property_docs, + nm_settings_docs_xml_gir, ], depends: libnm_gir, ) -- cgit v1.2.1