From 9e7d16acd9b20e15f69e47ef239ff4bc7149d220 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Wed, 9 May 2018 13:24:57 -0400 Subject: [PATCH] scripts: make runner a west subpackage This is a stepping-stone to adding runner functionality into west itself. Since all of the runner tools assume a Zephyr build directory layout, this doesn't put anything generic into a Zephyr-specific tool. Make minimal adjustments to zephyr_flash_debug.py to keep existing build system targets working unmodified. Signed-off-by: Marti Bolivar --- cmake/extensions.cmake | 11 ++++++----- cmake/flash/CMakeLists.txt | 2 +- scripts/{support => meta/west}/runner/__init__.py | 0 scripts/{support => meta/west}/runner/arc.py | 0 scripts/{support => meta/west}/runner/bossac.py | 0 scripts/{support => meta/west}/runner/core.py | 0 scripts/{support => meta/west}/runner/dfu.py | 0 scripts/{support => meta/west}/runner/esp32.py | 0 scripts/{support => meta/west}/runner/intel_s1000.py | 0 scripts/{support => meta/west}/runner/jlink.py | 0 scripts/{support => meta/west}/runner/nios2.py | 0 scripts/{support => meta/west}/runner/nrfjprog.py | 0 scripts/{support => meta/west}/runner/openocd.py | 0 scripts/{support => meta/west}/runner/pyocd.py | 0 scripts/{support => meta/west}/runner/qemu.py | 0 scripts/{support => meta/west}/runner/xtensa.py | 0 scripts/{support => meta}/zephyr_flash_debug.py | 2 +- 17 files changed, 8 insertions(+), 7 deletions(-) rename scripts/{support => meta/west}/runner/__init__.py (100%) rename scripts/{support => meta/west}/runner/arc.py (100%) rename scripts/{support => meta/west}/runner/bossac.py (100%) rename scripts/{support => meta/west}/runner/core.py (100%) rename scripts/{support => meta/west}/runner/dfu.py (100%) rename scripts/{support => meta/west}/runner/esp32.py (100%) rename scripts/{support => meta/west}/runner/intel_s1000.py (100%) rename scripts/{support => meta/west}/runner/jlink.py (100%) rename scripts/{support => meta/west}/runner/nios2.py (100%) rename scripts/{support => meta/west}/runner/nrfjprog.py (100%) rename scripts/{support => meta/west}/runner/openocd.py (100%) rename scripts/{support => meta/west}/runner/pyocd.py (100%) rename scripts/{support => meta/west}/runner/qemu.py (100%) rename scripts/{support => meta/west}/runner/xtensa.py (100%) rename scripts/{support => meta}/zephyr_flash_debug.py (98%) diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index f6e5a41b029..3d8013e573a 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -531,9 +531,10 @@ endmacro() # This section is for extensions which control Zephyr's board runners # from the build system. The Zephyr build system has targets for # flashing and debugging supported boards. These are wrappers around a -# "runner" Python package that is part of Zephyr. This section -# provides glue between CMake and the runner invocation script, -# zephyr_flash_debug.py. +# "runner" Python subpackage that is part of Zephyr's "west" tool. +# +# This section provides glue between CMake and the Python code that +# manages the runners. # This function is intended for board.cmake files and application # CMakeLists.txt files. @@ -541,8 +542,8 @@ endmacro() # Usage from board.cmake files: # board_runner_args(runner "--some-arg=val1" "--another-arg=val2") # -# The build system will then ensure the command line to -# zephyr_flash_debug.py contains: +# The build system will then ensure the command line used to +# create the runner contains: # --some-arg=val1 --another-arg=val2 # # Within application CMakeLists.txt files, ensure that all calls to diff --git a/cmake/flash/CMakeLists.txt b/cmake/flash/CMakeLists.txt index 82b492f1864..055f57c7d05 100644 --- a/cmake/flash/CMakeLists.txt +++ b/cmake/flash/CMakeLists.txt @@ -79,7 +79,7 @@ foreach(target flash debug debugserver) set(cmd ${CMAKE_COMMAND} -E env ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/support/zephyr_flash_debug.py + ${ZEPHYR_BASE}/scripts/meta/zephyr_flash_debug.py ${RUNNER_VERBOSE} ${runner} ${target} diff --git a/scripts/support/runner/__init__.py b/scripts/meta/west/runner/__init__.py similarity index 100% rename from scripts/support/runner/__init__.py rename to scripts/meta/west/runner/__init__.py diff --git a/scripts/support/runner/arc.py b/scripts/meta/west/runner/arc.py similarity index 100% rename from scripts/support/runner/arc.py rename to scripts/meta/west/runner/arc.py diff --git a/scripts/support/runner/bossac.py b/scripts/meta/west/runner/bossac.py similarity index 100% rename from scripts/support/runner/bossac.py rename to scripts/meta/west/runner/bossac.py diff --git a/scripts/support/runner/core.py b/scripts/meta/west/runner/core.py similarity index 100% rename from scripts/support/runner/core.py rename to scripts/meta/west/runner/core.py diff --git a/scripts/support/runner/dfu.py b/scripts/meta/west/runner/dfu.py similarity index 100% rename from scripts/support/runner/dfu.py rename to scripts/meta/west/runner/dfu.py diff --git a/scripts/support/runner/esp32.py b/scripts/meta/west/runner/esp32.py similarity index 100% rename from scripts/support/runner/esp32.py rename to scripts/meta/west/runner/esp32.py diff --git a/scripts/support/runner/intel_s1000.py b/scripts/meta/west/runner/intel_s1000.py similarity index 100% rename from scripts/support/runner/intel_s1000.py rename to scripts/meta/west/runner/intel_s1000.py diff --git a/scripts/support/runner/jlink.py b/scripts/meta/west/runner/jlink.py similarity index 100% rename from scripts/support/runner/jlink.py rename to scripts/meta/west/runner/jlink.py diff --git a/scripts/support/runner/nios2.py b/scripts/meta/west/runner/nios2.py similarity index 100% rename from scripts/support/runner/nios2.py rename to scripts/meta/west/runner/nios2.py diff --git a/scripts/support/runner/nrfjprog.py b/scripts/meta/west/runner/nrfjprog.py similarity index 100% rename from scripts/support/runner/nrfjprog.py rename to scripts/meta/west/runner/nrfjprog.py diff --git a/scripts/support/runner/openocd.py b/scripts/meta/west/runner/openocd.py similarity index 100% rename from scripts/support/runner/openocd.py rename to scripts/meta/west/runner/openocd.py diff --git a/scripts/support/runner/pyocd.py b/scripts/meta/west/runner/pyocd.py similarity index 100% rename from scripts/support/runner/pyocd.py rename to scripts/meta/west/runner/pyocd.py diff --git a/scripts/support/runner/qemu.py b/scripts/meta/west/runner/qemu.py similarity index 100% rename from scripts/support/runner/qemu.py rename to scripts/meta/west/runner/qemu.py diff --git a/scripts/support/runner/xtensa.py b/scripts/meta/west/runner/xtensa.py similarity index 100% rename from scripts/support/runner/xtensa.py rename to scripts/meta/west/runner/xtensa.py diff --git a/scripts/support/zephyr_flash_debug.py b/scripts/meta/zephyr_flash_debug.py similarity index 98% rename from scripts/support/zephyr_flash_debug.py rename to scripts/meta/zephyr_flash_debug.py index 4a28b76295d..e6c57dfe829 100755 --- a/scripts/support/zephyr_flash_debug.py +++ b/scripts/meta/zephyr_flash_debug.py @@ -19,7 +19,7 @@ import functools import sys import os -from runner.core import ZephyrBinaryRunner +from west.runner.core import ZephyrBinaryRunner def print_runners_handler(args):