From c5ae4698dd04d6ae34166f84f1e6c6b504920f89 Mon Sep 17 00:00:00 2001 From: MT Tsai Date: Fri, 24 Jun 2022 16:24:08 +0800 Subject: [PATCH] Put software version string as : on esp32 while doing automation testing --- examples/chef/chef.py | 6 ++++-- examples/chef/esp32/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index c4462401f7cc53..9de079a43a3108 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -501,6 +501,7 @@ def main(argv: Sequence[str]) -> None: # if options.do_build: + sw_ver_string = "" if options.do_automated_test_stamp: branch = "" for branch_text in shell.run_cmd("git branch", return_cmd_output=True).split("\n"): @@ -557,7 +558,8 @@ def main(argv: Sequence[str]) -> None: set(CONFIG_DEVICE_VENDOR_ID {options.vid}) set(CONFIG_DEVICE_PRODUCT_ID {options.pid}) set(CONFIG_ENABLE_PW_RPC {"1" if options.do_rpc else "0"}) - set(SAMPLE_NAME {options.sample_device_type_name})""")) + set(SAMPLE_NAME {options.sample_device_type_name}) + set(CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING \"{sw_ver_string}\")""")) if options.build_target == "esp32": shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/esp32") @@ -592,7 +594,7 @@ def main(argv: Sequence[str]) -> None: elif options.build_target == "linux": shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/linux") with open(f"{_CHEF_SCRIPT_PATH}/linux/args.gni", "w") as f: - sw_ver_string_config_text = f"chip_device_config_device_software_version_string = \"{sw_ver_string}\"" if options.do_automated_test_stamp else "" + sw_ver_string_config_text = f"chip_device_config_device_software_version_string = \"{sw_ver_string}\"" if sw_ver_string else "" f.write(textwrap.dedent(f"""\ import("//build_overrides/chip.gni") import("${{chip_root}}/config/standalone/args.gni") diff --git a/examples/chef/esp32/CMakeLists.txt b/examples/chef/esp32/CMakeLists.txt index d86d3efac2586e..cbf870141d89ee 100644 --- a/examples/chef/esp32/CMakeLists.txt +++ b/examples/chef/esp32/CMakeLists.txt @@ -37,8 +37,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(${CMAKE_CURRENT_LIST_DIR}/../project_include.cmake) message(STATUS "Product ID " ${CONFIG_DEVICE_PRODUCT_ID}) message(STATUS "Vendor ID " ${CONFIG_DEVICE_VENDOR_ID}) +message(STATUS "SW Version String" ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}) idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${CONFIG_DEVICE_PRODUCT_ID}" APPEND) idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${CONFIG_DEVICE_VENDOR_ID}" APPEND) +if(NOT ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING} STREQUAL "") + idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}\"" APPEND) +endif() idf_build_set_property(COMPILE_OPTIONS "-DCHIP_PLATFORM_ESP32=1" APPEND) project(chip-shell)