Skip to content

Commit

Permalink
[nrf toup] Include EXTRAVERSION in Matter software version string
Browse files Browse the repository at this point in the history
When a Matter application provides the VERSION file, the
Matter software version string is set to 4-number string,
such as "2.7.99+0" and the EXTRAVERSION field, which is
typically used to denote the branch or tag name, such as
"dev" or "rc1", is ignored.

If the EXTRAVERSION field is non-empty, set the Matter
software version string to a string such as "2.7.99-dev+0".
  • Loading branch information
Damian-Nordic committed Oct 18, 2024
1 parent 171a1d3 commit 731aac5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/zephyr/ota-image.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function(chip_ota_image TARGET_NAME)
"--version"
${APPVERSION}
"--version-str"
${APP_VERSION_TWEAK_STRING}
${APP_VERSION_EXTENDED_STRING}
"--digest-algorithm"
"sha256"
)
Expand Down
8 changes: 7 additions & 1 deletion config/zephyr/ota-image_sysbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ function(chip_ota_image TARGET_NAME)
set(app_version_patchlevel ${CMAKE_MATCH_1})
string(REGEX MATCH "VERSION_TWEAK = ([0-9]*)" _ ${ver})
set(app_version_tweak ${CMAKE_MATCH_1})
string(REGEX MATCH "EXTRAVERSION = ([a-z0-9]*)" _ ${ver})
set(app_version_extra ${CMAKE_MATCH_1})

set(APP_VERSION_STRING "${app_version_major}.${app_version_minor}.${app_version_patchlevel}+${app_version_tweak}")
if(app_version_extra)
set(APP_VERSION_STRING "${app_version_major}.${app_version_minor}.${app_version_patchlevel}-${app_version_extra}+${app_version_tweak}")
else()
set(APP_VERSION_STRING "${app_version_major}.${app_version_minor}.${app_version_patchlevel}+${app_version_tweak}")
endif()
math(EXPR APPVERSION "(${app_version_major} << 24) | (${app_version_minor} << 16) | (${app_version_patchlevel} << 8) | ${app_version_tweak}" OUTPUT_FORMAT HEXADECIMAL)

set(OTA_ARGS
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#ifdef CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#else
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING APP_VERSION_TWEAK_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING APP_VERSION_EXTENDED_STRING
#endif

#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE
Expand Down

0 comments on commit 731aac5

Please sign in to comment.