From 02ad7ef1f9cd3ea455dedbf62fc3a5cb0d73025d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 4 Jun 2024 09:55:22 +0200 Subject: [PATCH] doc: Add build env variable to know if doxygen has run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some extensions may be able to run faster if they can check if Doxygen contents has changed from one build to the other Signed-off-by: Benjamin Cabé --- doc/_extensions/zephyr/api_overview.py | 3 +++ doc/_extensions/zephyr/doxyrunner.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/_extensions/zephyr/api_overview.py b/doc/_extensions/zephyr/api_overview.py index 74a4d35ba69590..15bbe0e804b001 100644 --- a/doc/_extensions/zephyr/api_overview.py +++ b/doc/_extensions/zephyr/api_overview.py @@ -141,6 +141,9 @@ def sync_contents(app: Sphinx) -> None: else: doxygen_out_dir = Path(app.outdir) / "_doxygen" + if not app.env.doxygen_input_changed: + return + doxygen_xml_dir = doxygen_out_dir / "xml" groups = parse_xml_dir(doxygen_xml_dir) diff --git a/doc/_extensions/zephyr/doxyrunner.py b/doc/_extensions/zephyr/doxyrunner.py index 8bd10e63a97c97..64d4a2c793a478 100644 --- a/doc/_extensions/zephyr/doxyrunner.py +++ b/doc/_extensions/zephyr/doxyrunner.py @@ -362,8 +362,8 @@ def doxygen_build(app: Sphinx) -> None: ) logger.info("Checking if Doxygen needs to be run...") - changed = doxygen_input_has_changed(app.env, doxyfile) - if not changed: + app.env.doxygen_input_changed = doxygen_input_has_changed(app.env, doxyfile) + if not app.env.doxygen_input_changed: logger.info("Doxygen build will be skipped (no changes)!") return