forked from qt-creator/qt-creator
McuSupport: Enable os-specific executable version detection
Currently version detection fails in either Linux or Windows based on
the content of versionDetection.filePattern in the json kit file.
This change enables os-specific filePattern fields:
"versionDetection": {
"filePattern": {
"windows": "bin/arm-none-eabi-g++.exe",
"linux": "bin/arm-none-eabi-g++"
}
"executableArgs": "--version",
"regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b"
}
Simply appending the binary extension with withExecutableSuffix()
is less portable and does not reflect the validationPath field.
For McuPackageDirectoryEntriesVersionDetector and
McuPackageXmlVersionDetector to work correctly, they rely on
filePattern not having os-specific fields.
Also make getOsSpecificValue and parseVersionDetection static.
Change-Id: Ieacf376126043d732eeb5d5a2f4125963022ae76
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -80,7 +80,7 @@ const char armGccDir[]{"/opt/armgcc"};
|
||||
const char armGccDirectorySetting[]{"GNUArmEmbeddedToolchain"};
|
||||
const char armGccEnvVar[]{"ARMGCC_DIR"};
|
||||
const char armGccLabel[]{"GNU Arm Embedded Toolchain"};
|
||||
const char armGccSuffix[]{"bin/arm-none-eabi-g++"};
|
||||
const QString armGccSuffix{HostOsInfo::withExecutableSuffix("bin/arm-none-eabi-g++")};
|
||||
const char armGccToolchainFilePath[]{"/opt/qtformcu/2.2/lib/cmake/Qul/toolchain/armgcc.cmake"};
|
||||
const char armGccToolchainFileUnexpandedPath[]{"%{Qul_ROOT}/lib/cmake/Qul/toolchain/armgcc.cmake"};
|
||||
const char armGccVersion[]{"10.3.1"};
|
||||
@@ -1245,7 +1245,7 @@ void McuSupportTest::test_passExecutableVersionDetectorToToolchainPackage_data()
|
||||
<< armGccVersionDetectionRegex;
|
||||
|
||||
QTest::newRow("iar_stm32f469i_discovery_baremetal_json")
|
||||
<< iar_stm32f469i_discovery_baremetal_json << QString{"bin/iccarm"} << version
|
||||
<< iar_stm32f469i_discovery_baremetal_json << HostOsInfo::withExecutableSuffix("bin/iccarm") << version
|
||||
<< iarVersionDetectionRegex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user