MCPcopy Create free account
hub / github.com/FastLED/FastLED / _find_build_info

Function _find_build_info

ci/check_backend_flag_drift.py:397–423  ·  view source on GitHub ↗

Locate the most specific ``build_info_*.json`` for (board, example, backend). Search order: 1. ``.build/pio/ /build_info_ .json`` (both backends) 2. ``.build/pio/ /build_info.json`` 3. `` /build_info_ .json`` (fbuild top-level dump)

(
    project_root: Path, board: str, example: str, backend: str
)

Source from the content-addressed store, hash-verified

395
396
397def _find_build_info(
398 project_root: Path, board: str, example: str, backend: str
399) -> Path | None:
400 """Locate the most specific ``build_info_*.json`` for (board, example, backend).
401
402 Search order:
403 1. ``.build/pio/<board>/build_info_<example>.json`` (both backends)
404 2. ``.build/pio/<board>/build_info.json``
405 3. ``<project_root>/build_info_<board>.json`` (fbuild top-level dump)
406 4. ``<project_root>/build_info.json`` (fbuild generic dump)
407
408 The ``backend`` arg is kept for future use (e.g. backend-specific
409 suffixes) but currently both backends write into the same
410 ``.build/pio/<board>/`` directory because that&#x27;s the convention
411 ``generate_build_info_json_from_existing_build`` uses.
412 """
413 del backend # reserved for future use
414 candidates: list[Path] = [
415 project_root / ".build" / "pio" / board / f"build_info_{example}.json",
416 project_root / ".build" / "pio" / board / "build_info.json",
417 project_root / f"build_info_{board}.json",
418 project_root / "build_info.json",
419 ]
420 for c in candidates:
421 if c.exists():
422 return c
423 return None
424
425
426# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected