-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scons generate dbc files #1329
Scons generate dbc files #1329
Conversation
4ef1153
to
06b2e6f
Compare
8f6bfb7
to
de7ad25
Compare
Abstracted out the fuzzy find for generators in |
from opendbc.dbc.generator.generator import (generated_suffix, generator_path, opendbc_root, \ | ||
get_python_generator_scripts, get_source_dbc_files) | ||
Import('env') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks way too complicated. why not just glob everything in generator/*?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all .dbc
within generator dir being the sources for the generated DBCs :(
if filename.startswith('_') or not filename.endswith('.dbc'): |
glob.glob(f"{generated_path//.dbc}" with added conditional statements and replacing the .dbc
suffix with _generated.dbc
would be the same as what you referenced. All generated dbcs will be put into generator/../
while the source dbc could be from anywhere within the generator
path
it's easier abstract out the search functions to get the paths to generated dbcs, and to delete them when run with scons -c
for f in glob.glob(f"{generator_path}/*/*.py"): | ||
subprocess.check_call(f) | ||
|
||
def get_source_dbc_files(generator_path: str) -> defaultdict[str, list[str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, shouldn't need to touch this script
resolve #1309