@@ -95,12 +95,15 @@ <h1 class="title">Module <code>mbed_tools.project.mbed_program</code></h1>
95
95
return cls(program_files, mbed_os)
96
96
97
97
@classmethod
98
- def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -> "MbedProgram":
98
+ def from_existing(
99
+ cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
100
+ ) -> "MbedProgram":
99
101
"""Create an MbedProgram from an existing program directory.
100
102
101
103
Args:
102
104
dir_path: Directory containing an Mbed program.
103
- mbed_os_path: Directory containing Mbed OS
105
+ build_subdir: The subdirectory for the CMake build tree.
106
+ mbed_os_path: Directory containing Mbed OS.
104
107
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
105
108
exist.
106
109
@@ -114,7 +117,7 @@ <h1 class="title">Module <code>mbed_tools.project.mbed_program</code></h1>
114
117
program_root = dir_path
115
118
116
119
logger.info(f"Found existing Mbed program at path '{program_root}'")
117
- program = MbedProgramFiles.from_existing(program_root)
120
+ program = MbedProgramFiles.from_existing(program_root, build_subdir )
118
121
119
122
try:
120
123
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)
@@ -308,12 +311,15 @@ <h2 id="args">Args</h2>
308
311
return cls(program_files, mbed_os)
309
312
310
313
@classmethod
311
- def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -> "MbedProgram":
314
+ def from_existing(
315
+ cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
316
+ ) -> "MbedProgram":
312
317
"""Create an MbedProgram from an existing program directory.
313
318
314
319
Args:
315
320
dir_path: Directory containing an Mbed program.
316
- mbed_os_path: Directory containing Mbed OS
321
+ build_subdir: The subdirectory for the CMake build tree.
322
+ mbed_os_path: Directory containing Mbed OS.
317
323
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
318
324
exist.
319
325
@@ -327,7 +333,7 @@ <h2 id="args">Args</h2>
327
333
program_root = dir_path
328
334
329
335
logger.info(f"Found existing Mbed program at path '{program_root}'")
330
- program = MbedProgramFiles.from_existing(program_root)
336
+ program = MbedProgramFiles.from_existing(program_root, build_subdir )
331
337
332
338
try:
333
339
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)
@@ -342,16 +348,18 @@ <h2 id="args">Args</h2>
342
348
< h3 > Static methods</ h3 >
343
349
< dl >
344
350
< dt id ="mbed_tools.project.mbed_program.MbedProgram.from_existing "> < code class ="name flex ">
345
- < span > def < span class ="ident "> from_existing</ span > </ span > (< span > dir_path: pathlib.Path, mbed_os_path: pathlib.Path = None, check_mbed_os: bool = True) ‑> < a title ="mbed_tools.project.mbed_program.MbedProgram " href ="#mbed_tools.project.mbed_program.MbedProgram "> MbedProgram</ a > </ span >
351
+ < span > def < span class ="ident "> from_existing</ span > </ span > (< span > dir_path: pathlib.Path, build_subdir: pathlib.Path, mbed_os_path: pathlib.Path = None, check_mbed_os: bool = True) ‑> < a title ="mbed_tools.project.mbed_program.MbedProgram " href ="#mbed_tools.project.mbed_program.MbedProgram "> MbedProgram</ a > </ span >
346
352
</ code > </ dt >
347
353
< dd >
348
354
< div class ="desc "> < p > Create an MbedProgram from an existing program directory.</ p >
349
355
< h2 id ="args "> Args</ h2 >
350
356
< dl >
351
357
< dt > < strong > < code > dir_path</ code > </ strong > </ dt >
352
358
< dd > Directory containing an Mbed program.</ dd >
359
+ < dt > < strong > < code > build_subdir</ code > </ strong > </ dt >
360
+ < dd > The subdirectory for the CMake build tree.</ dd >
353
361
< dt > < strong > < code > mbed_os_path</ code > </ strong > </ dt >
354
- < dd > Directory containing Mbed OS</ dd >
362
+ < dd > Directory containing Mbed OS. </ dd >
355
363
< dt > < strong > < code > check_mbed_os</ code > </ strong > </ dt >
356
364
< dd > If True causes an exception to be raised if the Mbed OS source directory does not
357
365
exist.</ dd >
@@ -366,12 +374,15 @@ <h2 id="raises">Raises</h2>
366
374
< span > Expand source code</ span >
367
375
</ summary >
368
376
< pre > < code class ="python "> @classmethod
369
- def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -> "MbedProgram":
377
+ def from_existing(
378
+ cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
379
+ ) -> "MbedProgram":
370
380
"""Create an MbedProgram from an existing program directory.
371
381
372
382
Args:
373
383
dir_path: Directory containing an Mbed program.
374
- mbed_os_path: Directory containing Mbed OS
384
+ build_subdir: The subdirectory for the CMake build tree.
385
+ mbed_os_path: Directory containing Mbed OS.
375
386
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
376
387
exist.
377
388
@@ -385,7 +396,7 @@ <h2 id="raises">Raises</h2>
385
396
program_root = dir_path
386
397
387
398
logger.info(f"Found existing Mbed program at path '{program_root}'")
388
- program = MbedProgramFiles.from_existing(program_root)
399
+ program = MbedProgramFiles.from_existing(program_root, build_subdir )
389
400
390
401
try:
391
402
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)
0 commit comments