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>
To support extending the macros and calling the
McuTargetFactory::expandVariables function statically, the macros are
added as part of the SdkRepository.
This commit also adds helper functions to extend macros other than the
ones created from the packages.
Change-Id: Ie7d2a9ad626782eec18738bdd3472ffd202e7a36
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
McuPackageDirectoryVersionDetector class name was misleading,
McuPackageDirectoryEntriesVersionDetector better describes its
purpose as it can be used to search for a regex match among the
entries in packagePath filtered by filePattern. Also, remove
isFile boolean member variable since is not needed for current
use cases, ie Renesas Graphics library (RGL), and filePattern
can be used instead.
Also, improve version detector creation logic. If no filePattern
is present in the Json kit file, the regex match is based on
packagePath only, which is the correct way to detect the version
for RGL.
Task-number: UL-6642
Change-Id: I3ee2fdb623bdd77aea60f9eae3672b9b5aa40433
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
In case the JSON entry was missing completely, a directory version detector
was instantiated.
Instantiate version dectectors only if there is enough and valid
information available.
Change-Id: Iaf9cd40165e4d75124f3e0ddda66db2f4dab5ff7
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Before the refactoring, the various third party packages had detection
paths set to facilitate picking the correct subdirectory in QtCreator.
Adding these paths to the JSONs prompts hints in the Devices>MCU UI to
which path to enter, and prevents the user from picking the wrong path
Since the paths might vary based on the host-os, it is necessary to
enable parsing this from JSONs, similar to how the "defaultValue" is
handled. The "detectionPath" entry can either be an object with
separate values in fields named "windows" and "linux", or a string.
Change-Id: I813affe856fe73f6cf34ea75850500b49a1b2b6a
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Kwangsub Kim <kwangsub.kim@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
This allows to mention the file name the configuration was created from in
error messages.
Change-Id: Id8e3d4a754cf5c1f0a12c6b21af1158713c68690
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
QtMCUs will support MinGW toolchain for Windows desktop platform,
so MinGW toolchain needs to be identified.
If the default toolchain or a user configured one is a correct
MinGW toolchain, it would be selected. If not, a proper toolchain
would be picked up from the registered toolchains in Qt Creator.
Task-number: UL-6607
Change-Id: I82580d721d9ed916a6b32d35c124a638d7a3e68e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
An entry called "addToSystemPath" was added to JSON files to signal
whether the corresponding path should also be added to the system path.
Task-number: UL-6409
Change-Id: I2d7ba38b3905d67475a3c482692e4f8e21d4141e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit fb643db088)
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
default values can vary between windows and linux so when it is the
case a json object can be specified to describe the default values for
both.
Change-Id: Ifd3e4225ba0e1b1760f93ecea9cfafa4545c3404
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This synchronizes JSON files used by unit tests with files
in QtMCUs repo. To do that some changes in code were needed.
QtMCUs package is no longer created for each JSON file. Because of
its nature it's created once and passed to each target.
Unit tests now have verifyPackage function to avoid duplication
of checks.
In test creating target QtMCUs package is checked beside toolchain
ones.
Change-Id: I5dea470daf184b45facfaaa793c359310ac22fc1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
It is easy to pick the wrong directory for FreeRTOS sources when
configuring an MCU device. This commit adds a check that the
supplied path contains tasks.c, which probably means the given
directory is correct.
Task-number: QTCREATORBUG-27180
Change-Id: Iff1242e8970e59bf334d50829dd1d5bdd8164d47
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).
Change-Id: Ib644dd6178bf9e0a1a75a2c6cf49fd5f3d121cf4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Packages are created as defined in JSON. Some paths
contain variables. This creates dependencies between
packages. After all packages are created and collected
environment variables are evaluated in one pass. McuTarget
packages get updated.
This is needed because we shouldn't show the user paths
with variables in them. Also file picker wouldn't work.
There will be cmake variables support in separate commit.
Change-Id: Id210ea394f3f5bb5a14d87f3cf6a0a9a99e690bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Post merge updates for the "Add toolchain information for desktop kits"
task.
Task-number: QTCREATORBUG-26750
Change-Id: Idd230589650f88d921f5f97c2bbecabac4784584
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Create appropriate instance of version detector depending on
parsed data from JSON and pass it to McuPackage's ctor. Also tests.
Change-Id: I4f7e5cd6d998745dfe951284c34904526abc216b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Mostly unused #include's, also sort them or reduce scope.
A few namespaces, ...
Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
qtc9 will use new implementation for qtForMCUs 2.3 and newer.
Legacy implementation will be used for older versions.
Change-Id: Ibb2919f25d03d6445b8328e20316d4f88203a463
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
For new implementation toolchain packages must be added
to rest of traget's packages to be visible in UI.
Change-Id: I6804a114e05caac1d864ceffb378f3f61481c433
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Adapt legacy implementation and pass appropriate data
to new implementation in McuTargetFactory::createPackage.
Change-Id: I13e0896e219cea2629e15de2a6885df457249790
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Use smart pointer for member of McuPackage.
Change-Id: I2474fc791b91c489be77aee3aab86401aaef76e8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
New implementation of mcu support plugin is not yet finished
so we should use legacy implementation for QtMCUs 2.2 JSON kits.
Change-Id: I8e6a8b7af2c3b4683bb19a5f05edd6ff5df46e5b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Note, this also changes how the CMAKE_TOOLCHAIN_FILE is stored
inside the settings.
Change-Id: I018cc44be37deef36d685eb856bb706f47274017
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Toolchain package represents information about compiler and toolchain
file (.cmake). This information is parsed from JSON and used for Kit
creation. This includes cmake variables, path to compiler. This patch
extracts information about toolchain file into separate McuPackage.
Change-Id: Id165bdc5afa5d7cf5b5c96620e11cb878254c181
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>