Thomas Haller 2020-11-03 15:42:12 +01:00
commit e814b59635
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
7 changed files with 1166 additions and 33 deletions

View file

@ -1602,8 +1602,20 @@ libnm_noinst_data = \
noinst_DATA += $(libnm_noinst_data)
EXTRA_DIST += clients/cli/generate-docs-nm-settings-nmcli.xml.in
if BUILD_DOCS
clients/cli/generate-docs-nm-settings-nmcli.xml: clients/cli/generate-docs-nm-settings-nmcli
$(AM_V_GEN) clients/cli/generate-docs-nm-settings-nmcli > $@
$(AM_V_GEN) clients/cli/generate-docs-nm-settings-nmcli > "$@"
check-local-generate-docs-nm-settings-nmcli: clients/cli/generate-docs-nm-settings-nmcli.xml
$(srcdir)/tools/check-compare-generated.sh "$(srcdir)" "$(builddir)" "$<"
check_local += check-local-generate-docs-nm-settings-nmcli
DISTCLEANFILES += clients/cli/generate-docs-nm-settings-nmcli.xml
else
clients/cli/generate-docs-nm-settings-nmcli.xml: clients/cli/generate-docs-nm-settings-nmcli.xml.in
$(AM_V_GEN) cp $^ $@
check-local-generate-docs-nm-settings-nmcli:
endif
libnm_docs_sources = $(libnm_core_lib_c_settings_real)
@ -4453,12 +4465,12 @@ $(clients_common_libnmc_base_la_OBJECTS): $(libnm_lib_h_pub_mkenums)
$(clients_common_libnmc_base_la_OBJECTS): clients/common/.dirstamp
clients_common_settings_doc_h = clients/common/settings-docs.h
if HAVE_INTROSPECTION
if BUILD_DOCS
$(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)
$(srcdir)/tools/check-settings-docs.sh "$(srcdir)" "$(builddir)" "$(clients_common_settings_doc_h)"
$(srcdir)/tools/check-compare-generated.sh "$(srcdir)" "$(builddir)" "$(clients_common_settings_doc_h)"
check_local += check-local-settings-docs
else
$(clients_common_settings_doc_h): $(clients_common_settings_doc_h).in clients/common/.dirstamp
@ -5285,7 +5297,7 @@ EXTRA_DIST += \
tools/check-config-options.sh \
tools/check-docs.sh \
tools/check-exports.sh \
tools/check-settings-docs.sh \
tools/check-compare-generated.sh \
tools/create-exports-NetworkManager.sh \
tools/debug-helper.py \
tools/meson-post-install.sh \

File diff suppressed because it is too large Load diff

View file

@ -50,9 +50,23 @@ generate_docs_nm_settings_nmcli = executable(
link_depends: linker_script_binary,
)
generate_docs_nm_settings_nmcli_xml = custom_target(
'generate-docs-nm-settings-nmcli.xml',
output: 'generate-docs-nm-settings-nmcli.xml',
command: [ generate_docs_nm_settings_nmcli ],
capture: true,
)
if enable_docs
generate_docs_nm_settings_nmcli_xml = custom_target(
'generate-docs-nm-settings-nmcli.xml',
output: 'generate-docs-nm-settings-nmcli.xml',
command: [ generate_docs_nm_settings_nmcli ],
capture: true,
)
test(
'check-local-generate-docs-nm-settings-nmcli',
find_program(join_paths(source_root, 'tools', 'check-compare-generated.sh')),
args: [source_root, build_root, 'clients/cli/generate-docs-nm-settings-nmcli.xml'],
)
else
settings_docs_source = configure_file(
input: 'generate-docs-nm-settings-nmcli.xml.in',
output: '@BASENAME@',
configuration: configuration_data(),
)
endif

View file

@ -31,7 +31,7 @@ libnmc_base_dep = declare_dependency(
settings_docs = 'settings-docs.h'
if enable_introspection
if enable_docs
settings_docs_source = custom_target(
settings_docs,
input: nm_settings_docs_xml_gir,
@ -41,7 +41,7 @@ if enable_introspection
test(
'check-settings-docs',
find_program(join_paths(source_root, 'tools', 'check-settings-docs.sh')),
find_program(join_paths(source_root, 'tools', 'check-compare-generated.sh')),
args: [source_root, build_root, 'clients/common/' + settings_docs],
)
else

View file

@ -751,6 +751,8 @@ if enable_nm_cloud_setup
assert(libcurl_dep.found(), 'nm-cloud-setup requires libcurl library. Use -Dnm_cloud_setup=false to disable it')
endif
enable_docs = get_option('docs')
more_asserts = get_option('more_asserts')
if more_asserts == 'auto'
if nm_minor_version % 2 == 0
@ -920,8 +922,6 @@ if enable_qt
subdir('examples/C/qt')
endif
enable_docs = get_option('docs')
if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
assert(meson.version().version_compare('>= 0.46.0'), '-Ddocs requires meson >= 0.46')

View file

@ -0,0 +1,18 @@
#!/bin/sh
set -e
srcdir="$1"
builddir="$2"
doc_h="$3"
[ -n "$NMTST_NO_CHECK_SETTINGS_DOCS" ] && exit 0
cmp -s "${srcdir}/${doc_h}.in" "${builddir}/${doc_h}" && exit 0
if [ "$NM_TEST_REGENERATE" = 1 ] ; then
cp -f "${builddir}/${doc_h}" "${srcdir}/${doc_h}.in"
else
echo "*** Error: the generated file '${builddir}/${doc_h}' differs from the source file '${srcdir}/${doc_h}.in'. You probably should copy the generated file over to the source file. You can skip this test by setting NMTST_NO_CHECK_SETTINGS_DOCS=yes. You can also automatically copy the file by rerunning the test with NM_TEST_REGENERATE=1"
exit 1
fi

View file

@ -1,19 +0,0 @@
#!/bin/sh
srcdir=$1
builddir=$2
doc_h=$3
if [ -z "$NMTST_NO_CHECK_SETTINGS_DOCS" ] ; then
if ! cmp -s "${srcdir}/${doc_h}.in" "${builddir}/${doc_h}"; then
if [ "$NM_TEST_REGENERATE" = 1 ] ; then
cp -f "${builddir}/${doc_h}" "${srcdir}/${doc_h}.in"
else
echo "*** Error: the generated file '${builddir}/${doc_h}' differs from the source file '${srcdir}/${doc_h}.in'. You probably should copy the generated file over to the source file. You can skip this test by setting NMTST_NO_CHECK_SETTINGS_DOCS=yes. You can also automatically copy the file by rerunning the test with NM_TEST_REGENERATE=1"
exit 1
fi
fi
fi
exit 0