Skip to content

Commit cef1c25

Browse files
committed
scripts: flash: Add west config for flash skip rebuild
Add a west config option to skip rebuilds by default or not when doing west flash. Signed-off-by: Declan Snyder <[email protected]>
1 parent 18497c5 commit cef1c25

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

doc/develop/west/build-flash-debug.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,22 @@ only the image from this domain::
551551

552552
.. _west-debugging:
553553

554+
Configuration Options
555+
=====================
556+
557+
You can :ref:`configure <west-config-cmd>` ``west flash`` using these options.
558+
559+
.. NOTE: docs authors: keep this table sorted alphabetically
560+
561+
.. list-table::
562+
:widths: 10 30
563+
:header-rows: 1
564+
565+
* - Option
566+
- Description
567+
* - ``flash.skip-rebuild``
568+
- Boolean, default ``false``. If ``true``, do not rebuild on west flash.
569+
554570
Debugging: ``west debug``, ``west debugserver``
555571
***********************************************
556572

scripts/west_commands/run_common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,13 @@ def do_run_common(command, user_args, user_runner_args, domain_file=None):
242242
import_from_path(
243243
module.meta.get("name", "runners_ext"), Path(module.project) / runner["file"]
244244
)
245-
246245
build_dir = get_build_dir(user_args)
247-
if not user_args.skip_rebuild:
246+
247+
# Check if skip-rebuild is configured globally
248+
skip_rebuild_config = config.get('flash', 'skip-rebuild', fallback='false')
249+
skip_rebuild = user_args.skip_rebuild or (skip_rebuild_config.lower() == 'true')
250+
251+
if not skip_rebuild:
248252
rebuild(command, build_dir, user_args)
249253

250254
domains = get_domains_to_process(build_dir, user_args, domain_file)

0 commit comments

Comments
 (0)