openpilot/opendbc_repo/opendbc/dbc/SConscript
Vehicle Researcher c5d5c5d1f3 openpilot v0.10.1 release
date: 2025-10-24T00:30:59
master commit: 405631baf9685e171a0dd19547cb763f1b163d18
2025-10-24 00:31:03 -07:00

32 lines
731 B
Python

import os
from pathlib import Path
env = Environment(ENV=os.environ)
generator = File("generator/generator.py")
source_files = [
File(str(f))
for f in Path("generator").rglob("*")
if f.is_file() and f.suffix in {".py", ".dbc"}
]
output_files = [
f.name.replace(".dbc", "_generated.dbc")
for f in Path("generator").rglob("*.dbc")
if not f.name.startswith("_")
]
# include DBCs generated by python scripts
output_files += [
f.name.replace(".py", "_generated.dbc")
for f in Path("generator").rglob("*.py")
if not f.name.startswith(("_", "test_")) and f.name != "generator.py"
]
generated = env.Command(
target=list(set(output_files)),
source=[generator] + source_files,
action="python3 ${SOURCES[0]}",
)