From c276f5daca6b07b424c83be24a6a91ae2727cf5e Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 6 Jan 2025 18:28:18 +0100 Subject: [PATCH] doc: store path to dynamic library in plugin configuration This can then be used by the pre-commit hook to avoid rebuilding complete plugin caches to check a change, thus minimizing the potential diff and making analysis of completely-unrelated cache diffs much less likely. Part-of: --- .../docs/gst-plugins-doc-cache-generator.py | 8 ++++++++ subprojects/gstreamer/docs/meson.build | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/subprojects/gstreamer/docs/gst-plugins-doc-cache-generator.py b/subprojects/gstreamer/docs/gst-plugins-doc-cache-generator.py index 1f564e4295..092c51417a 100755 --- a/subprojects/gstreamer/docs/gst-plugins-doc-cache-generator.py +++ b/subprojects/gstreamer/docs/gst-plugins-doc-cache-generator.py @@ -48,6 +48,7 @@ class GstPluginsHotdocConfGen: parser.add_argument('--include_paths', nargs='*', default=[]) parser.add_argument('--gst_c_source_filters', nargs='*', default=[]) parser.add_argument('--gst_c_source_file', type=P) + parser.add_argument('--gst_plugin_libraries_file', type=P) parser.add_argument('--output', type=P) parser.parse_args(namespace=self, args=sys.argv[2:]) @@ -61,6 +62,12 @@ class GstPluginsHotdocConfGen: else: gst_c_source_map = {} + if self.gst_plugin_libraries_file is not None: + with self.gst_plugin_libraries_file.open() as fd: + gst_plugin_libraries_map = json.load(fd) + else: + gst_plugin_libraries_map = {} + with self.gst_cache_file.open() as fd: all_plugins = json.load(fd) @@ -91,6 +98,7 @@ class GstPluginsHotdocConfGen: 'gst_c_source_filters': [str(s) for s in self.gst_c_source_filters], 'include_paths': self.include_paths, 'gst_order_generated_subpages': True, + 'gst_plugin_library': gst_plugin_libraries_map.get(plugin_name), }, f, indent=4) if self.output is not None: diff --git a/subprojects/gstreamer/docs/meson.build b/subprojects/gstreamer/docs/meson.build index 7df2f8f7db..4629ef2066 100644 --- a/subprojects/gstreamer/docs/meson.build +++ b/subprojects/gstreamer/docs/meson.build @@ -168,6 +168,22 @@ cdir = meson.current_source_dir() doc_source_file = configure_file(output: 'doc_sources.json', configuration: plugin_sources, output_format: 'json') +plugin_libraries = {} + +foreach plugin: plugins + if plugin.name().startswith('gst') + plugin_name = plugin.name().substring(3) + else + plugin_name = plugin.name() + endif + + plugin_libraries += { + plugin_name: plugin.full_path() + } +endforeach + +doc_plugin_libs_file = configure_file(output: 'doc_plugin_libs.json', configuration: plugin_libraries, output_format: 'json') + plugin_hotdoc_configs = custom_target( 'build-hotdoc-configs', command: [ @@ -179,6 +195,7 @@ plugin_hotdoc_configs = custom_target( '--index', cdir / 'plugins/index.md', '--gst_index', cdir / 'plugins/index.md', '--gst_c_source_file', doc_source_file, + '--gst_plugin_libraries_file', doc_plugin_libs_file, '--gst_c_sources', cdir / '../plugins/*/*.c', cdir / '../plugins/*/*.h',