(daplink_dir, build_folder, project, toolchain, clean, verbosity)
| 34 | exit(1) |
| 35 | |
| 36 | def mbedcli_run(daplink_dir, build_folder, project, toolchain, clean, verbosity): |
| 37 | generate_mbedcli_files(os.path.join(daplink_dir, "projects.yaml"), project) |
| 38 | project_dir=os.path.join(daplink_dir, build_folder, project.upper()) |
| 39 | if clean is True and os.path.exists(project_dir): |
| 40 | print("Deleting %s" % project_dir) |
| 41 | shutil.rmtree(project_dir, ignore_errors=True) |
| 42 | args = ["mbed", "compile", "-m", project, "-t", toolchain, "--profile", "custom_profile.json"] |
| 43 | if verbosity is not None: |
| 44 | args.append("-" + "v" * verbosity) |
| 45 | call_and_copy_output(args) |
| 46 | cli_name_out = os.path.basename(daplink_dir) |
| 47 | build_dir = os.path.join(project_dir, toolchain+"-CUSTOM_PROFILE") |
| 48 | for file in os.listdir(build_dir): |
| 49 | if file.startswith(cli_name_out): |
| 50 | rename_file = os.path.join(build_dir, file.replace(cli_name_out, project, 1)) |
| 51 | if os.path.exists(rename_file): |
| 52 | os.remove(rename_file) |
| 53 | os.rename(os.path.join(build_dir, file), rename_file) |
| 54 | cli_hex_output = os.path.join(build_dir, project + ".hex") |
| 55 | crc_file_output = os.path.join(build_dir, project + "_crc") |
| 56 | return (cli_hex_output,crc_file_output) |
nothing calls this directly
no test coverage detected