Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found
6 SPDX-License-Identifier: Apache-2.0
16 - Doxygen build is run before Sphinx reads input files
17 - Doxyfile can be optionally pre-processed so that variables can be inserted
18 - Changes in the Doxygen input files are tracked so that Doxygen build is only
19 run if necessary.
20 - Synchronizes Doxygen XML output so that even if Doxygen is run only changed,
21 deleted or added files are modified.
25 - https://github.com/michaeljones/breathe/issues/420
30 - ``doxyrunner_doxygen``: Path to the Doxygen binary.
31 - ``doxyrunner_doxyfile``: Path to Doxyfile.
32 - ``doxyrunner_outdir``: Doxygen build output directory (inserted to
34 - ``doxyrunner_outdir_var``: Variable representing the Doxygen build output
35 directory, as used by ``OUTPUT_DIRECTORY``. This can be useful if other
37 - ``doxyrunner_fmt``: Flag to indicate if Doxyfile should be formatted.
38 - ``doxyrunner_fmt_vars``: Format variables dictionary (name: value).
39 - ``doxyrunner_fmt_pattern``: Format pattern.
40 - ``doxyrunner_silent``: If Doxygen output should be logged or not. Note that
41 this option may not have any effect if ``QUIET`` is set to ``YES``.
64 def hash_file(file: Path) -> str:
74 with open(file, encoding="utf-8") as f:
75 sha256 = hashlib.sha256(f.read().encode("utf-8"))
79 def get_doxygen_option(doxyfile: str, option: str) -> list[str]:
93 option_re = re.compile(r"^\s*([A-Z0-9_]+)\s*=\s*(.*)$")
97 found = False
100 if not found:
102 if not m or m.group(1) != option:
105 found = True
109 if not m:
114 # check if it is a multiline value
118 if not finished:
119 value = value[:-1]
124 if finished:
138 ) -> str:
148 silent: If Doxygen should be run in quiet mode or not.
149 fmt: If Doxyfile should be formatted.
177 "QUIET=" + "YES" if silent else "NO",
182 if fmt:
183 if not fmt_pattern or not fmt_vars:
186 if outdir_var:
196 def doxygen_input_has_changed(env: BuildEnvironment, doxyfile: str) -> bool:
197 """Check if Doxygen input files have changed.
204 True if changed, False otherwise.
207 # obtain Doxygen input files and patterns
209 if not input:
210 raise ValueError("No INPUT set in Doxyfile")
213 if not file_patterns:
214 raise ValueError("No FILE_PATTERNS set in Doxyfile")
216 # build a set with input files hash
220 if path.is_file():
227 # check if any file has changed
228 if hasattr(env, "doxyrunner_cache") and env.doxyrunner_cache == cache:
237 def process_doxygen_output(line: str, silent: bool) -> None:
242 messages, if not silent, will be mapped to the info logger channel.
246 silent: True if regular messages should be logged, False otherwise.
249 m = re.match(r"(.*):(\d+): ([a-z]+): (.*)", line)
250 if m:
253 if type == "error":
263 def run_doxygen(doxygen: str, doxyfile: str, silent: bool = False) -> None:
269 silent: If Doxygen output should be logged or not.
276 p = Popen([doxygen, f_doxyfile_name], stdout=PIPE, stderr=STDOUT, encoding="utf-8")
279 if line:
281 if p.poll() is not None:
286 if p.returncode:
287 raise OSError(f"Doxygen process returned non-zero ({p.returncode})")
290 def sync_doxygen(doxyfile: str, new: Path, prev: Path) -> None:
293 This function makes sure that only new, deleted or changed files are
304 if generate_html[0] == "YES":
306 if not html_output:
307 raise ValueError("No HTML_OUTPUT set in Doxyfile")
312 if prev_htmldir.exists():
317 if not xml_output:
318 raise ValueError("No XML_OUTPUT set in Doxyfile")
323 if prev_xmldir.exists():
337 def doxygen_build(app: Sphinx) -> None:
344 if app.config.doxyrunner_outdir:
363 logger.info("Checking if Doxygen needs to be run...")
365 if not app.env.doxygen_input_changed:
366 logger.info("Doxygen build will be skipped (no changes)!")
382 def setup(app: Sphinx) -> dict[str, Any]:
392 app.connect("builder-inited", doxygen_build)