|
32 | 32 | # optional wippersnapper argument to generate a dependencies header file |
33 | 33 | PRINT_DEPENDENCIES_AS_HEADER = False |
34 | 34 | INCLUDE_PRINT_DEPENDENCIES_HEADER = False |
| 35 | +PRINT_DEPENDENCIES_AS_HEADER_FILENAME = None |
35 | 36 | if "--include_print_dependencies_header" in sys.argv: |
| 37 | + # check argument not null and folder path exists |
| 38 | + PRINT_DEPENDENCIES_AS_HEADER_FILENAME = sys.argv[sys.argv.index("--include_print_dependencies_header") + 1] if len(sys.argv) > sys.argv.index("--include_print_dependencies_header") + 1 else None |
| 39 | + if PRINT_DEPENDENCIES_AS_HEADER_FILENAME is None or not os.path.exists(PRINT_DEPENDENCIES_AS_HEADER_FILENAME): |
| 40 | + raise AttributeError("Header file path not found or not provided to --include_print_dependencies_header argument") |
36 | 41 | INCLUDE_PRINT_DEPENDENCIES_HEADER = True |
| 42 | + sys.argv.pop(sys.argv.index("--include_print_dependencies_header") + 1) |
37 | 43 | sys.argv.remove("--include_print_dependencies_header") |
38 | 44 |
|
39 | 45 | # add user bin to path! |
@@ -497,7 +503,7 @@ def test_examples_in_folder(platform, folderpath): |
497 | 503 | if PRINT_DEPENDENCIES_AS_HEADER: |
498 | 504 | # Extract dependencies and write to header for the first successful example |
499 | 505 | dependencies = extract_dependencies(out.decode("utf-8") + err.decode("utf-8")) |
500 | | - write_dependencies_to_header(dependencies, os.path.join(BUILD_DIR, 'print_dependencies.h')) |
| 506 | + write_dependencies_to_header(dependencies, PRINT_DEPENDENCIES_AS_HEADER_FILENAME) |
501 | 507 | elif os.path.exists(gen_file_name): |
502 | 508 | if ALL_PLATFORMS[platform][1] is None: |
503 | 509 | ColorPrint.print_info("Platform does not support UF2 files, skipping...") |
|
0 commit comments