kde/kf6-extra-cmake-modules: rebase to 6.28.0 (ECM) + teach version parser set(VERSION)

kf6-kcoreaddons 6.28.0 requires ECM >= 6.28.0 but the vendored ECM source/ was
still 6.10.0: the sync engine skipped it because ECM's version marker is a bare
set(VERSION "X.Y.Z") that the parser didn't recognize (only KF_VERSION /
PROJECT_VERSION / RELEASE_SERVICE_VERSION). Re-lay ECM from its 6.28.0 source.tar
(pure cmake modules, no Redox port) and teach both the sync engine and the
validator to read set(VERSION) so this class is caught, not silently skipped.
This commit is contained in:
2026-08-01 08:07:00 +03:00
parent 1488226b91
commit e0590a0b56
151 changed files with 1654 additions and 554 deletions
@@ -47,8 +47,32 @@ The following variables impact the behavior:
This allows to separate e.g. development files from what ends up in the APK.
Since 6.0.0
For automatically deriving APK versions from CMake this creates a ``ecm-version.gradle``
file which defines the following variables:
``ecmVersionName``: Set to ``PROJECT_VERSION``
``ecmVersionCode``: Derived from the current time in local builds, and from ``CI_PIPELINE_CREATED_AT``
in builds from Gitlab pipelines. This ensures a strictly increasing version code as well as
synchronized version codes for APKs of multiple architectures when build in a Gitlab pipeline.
This can be included by calling ``apply from: '../ecm-version.gradle'`` in the project's ``build.gradle``
file and is typically used in manifest placeholders:
```
defaultConfig {
versionName ecmVersionName
versionCode ecmVersionCode
manifestPlaceholders = [versionName: ecmVersionName, versionCode: ecmVersionCode]
...
}
```
Since 6.12.0
#]=======================================================================]
cmake_policy(VERSION 3.16)
# make ExecuteCoreModules test pass on Qt5
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
if (QT_MAJOR_VERSION EQUAL 5)
@@ -69,12 +93,22 @@ function (ecm_add_android_apk TARGET)
return()
endif()
# F-Droid assumes that APKs of different versions have different filenames;
# therefore, on CI we add the CI_PIPELINE_CREATED_AT timestamp to the APK filename
set(APK_NAME_TIMESTAMP "")
if (DEFINED ENV{CI_PIPELINE_CREATED_AT})
# remove all non-digits from an ISO 8601 formatted timestamp like 2025-05-21T16:00:54Z
string(REGEX REPLACE "^([0-9]+)-([0-9]+)-([0-9]+)T([0-9]+):([0-9]+):([0-9]+).*$" "-\\1\\2\\3\\4\\5\\6" APK_NAME_TIMESTAMP "$ENV{CI_PIPELINE_CREATED_AT}")
endif()
configure_file(${_ECM_TOOLCHAIN_DIR}/ecm-version.gradle.in ${CMAKE_BINARY_DIR}/ecm-version.gradle)
set(APK_NAME "${TARGET}")
if (ARGS_PACKAGE_NAME)
set(APK_NAME "${ARGS_PACKAGE_NAME}")
endif()
set(APK_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${TARGET}_build_apk/")
set(APK_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${APK_NAME}_build_apk/")
set(APK_EXECUTABLE_PATH "${APK_OUTPUT_DIR}/libs/${CMAKE_ANDROID_ARCH_ABI}/lib${APK_NAME}_${CMAKE_ANDROID_ARCH_ABI}.so")
set(QML_IMPORT_PATHS "")
@@ -151,7 +185,7 @@ function (ecm_add_android_apk TARGET)
file(WRITE ${CMAKE_BINARY_DIR}/ranlib "${CMAKE_RANLIB}")
set(CREATEAPK_TARGET_NAME "create-apk-${APK_NAME}")
set(APK_NAME_FULL "${APK_NAME}-${CMAKE_ANDROID_ARCH_ABI}.apk")
set(APK_NAME_FULL "${APK_NAME}${APK_NAME_TIMESTAMP}-${CMAKE_ANDROID_ARCH_ABI}.apk")
add_custom_target(${CREATEAPK_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Generating ${APK_NAME_FULL} with $<TARGET_FILE:Qt6::androiddeployqt>"