Skip to content

Commit e84e370

Browse files
pi-anlJosverl
authored andcommitted
Add stub location summary at completion
Display a summary showing where stubs were generated after successful completion. Shows both raw stub paths and merged stub paths for each board processed, making it easier for users to find the generated files.
1 parent b3870dc commit e84e370

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/stubber/bulk/mcu_stubber.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from stubber import utils
2323
from stubber.publish.merge_docstubs import merge_all_docstubs
24-
from stubber.publish.pathnames import board_folder_name
24+
from stubber.publish.pathnames import board_folder_name, get_merged_path
2525
from stubber.publish.publish import build_multiple
2626
from stubber.utils.config import CONFIG
2727

@@ -339,6 +339,9 @@ def stub_connected_mcus(
339339

340340
show_mcus(connected_mcus, refresh=False)
341341

342+
# Track stub locations for final summary
343+
stub_locations = []
344+
342345
# scan boards and generate stubs
343346
for board in connected_mcus:
344347
log.info(f"Connecting using {board.serialport} to {board.port} {board.board} {board.version}: {board.description}")
@@ -353,6 +356,13 @@ def stub_connected_mcus(
353356
log.success(f"Stubs generated for {board.firmware['port']}-{board.firmware['board']}")
354357
if destination := copy_to_repo(my_stubs, board.firmware):
355358
log.success(f"Stubs copied to {destination}")
359+
# Track location for final summary
360+
merged_path = get_merged_path(board.firmware)
361+
stub_locations.append({
362+
'raw': destination,
363+
'merged': merged_path,
364+
'board': f"{board.firmware['port']}-{board.firmware['board']}"
365+
})
356366
# Also merge the stubs with the docstubs
357367
log.info(f"Merging stubs with docstubs : {board.firmware}")
358368

@@ -377,6 +387,16 @@ def stub_connected_mcus(
377387

378388
if all_built:
379389
print_result_table(all_built)
390+
391+
# Print summary of stub locations
392+
if stub_locations:
393+
log.info("")
394+
log.info("Stub locations:")
395+
for loc in stub_locations:
396+
log.info(f" {loc['board']}:")
397+
log.info(f" Raw stubs: {loc['raw']}")
398+
log.info(f" Merged stubs: {loc['merged']}")
399+
380400
log.success("Done")
381401
return OK
382402
log.error(f"Failed to generate stubs for {board.serialport}")

0 commit comments

Comments
 (0)