Commit Graph

28 Commits

Author SHA1 Message Date
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
Piotr Mućko
cb24da01b3 McuSupport: Evaluate environment variables in paths
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>
2022-08-17 12:17:38 +00:00
Piotr Mućko
2e70915ab0 McuSupport: Use FilePath::fromUserInput instead of fromString
to normalize path separators for all OS-es

Change-Id: Iad6ea4abf21ba57705e07007bb238ebd7748ecfe
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
2022-08-01 14:01:47 +00:00
Yasser Grimes
d4efef7fc4 McuSupport: Add toolchain information for desktop kits
To be able to check the validity of a desktop toolchain used in an
mcusupport kit with qt platform.

Task-number: QTCREATORBUG-26750
Change-Id: Ifc518257844c8994150f3d86eb5512701c38c2b7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-25 10:49:31 +00:00
Piotr Mućko
ca9e652716 McuSupport: Use env variable as package's primary value
Use env variable value as primary source before values from settings
and fallback value from JSON.

Change-Id: I0c0a4c2cdac65a075d9f38aa1557a9d303b30a5e
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-07-22 11:43:33 +00:00
Piotr Mućko
5be5f7a331 McuSupport: Version detection handling for kit requirements
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>
2022-07-11 07:23:38 +00:00
hjk
7cc06b85d0 Replace more used of PathChooser::pathChanged by filePathChanged
Change-Id: I0f92be6fcfd0a5319ad9f5d3681266966e40705e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-01 10:07:24 +00:00
Piotr Mućko
2bdb75ac7a McuSupport: Pass versioning from json to McuPackage ctor
Use versions parameter from JSON kits.
Instead of setting version in separate step pass it directly
to ctor.

Change-Id: I7ac9017d56dafa316f95ba4c504dcb0af641dbdc
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-17 06:54:24 +00:00
Piotr Mućko
3c3ea74ca2 McuSupport: Separate toolchain file and compiler packages
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>
2022-05-06 08:52:16 +00:00
Piotr Mućko
7cef593ec0 McuSupport: Extract settings handling to a class
Change-Id: I671098f14d7bc13255dc130a4de1ab97d5bdab94
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-28 10:29:20 +00:00
Piotr Mućko
1587896537 McuSupport: Use FilePath in version detector
Change-Id: I54d04881c0b759caeaa83156c606a539369f482b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-04-27 10:38:58 +00:00
Piotr Mućko
80c87ddceb McuSupport: create toolchain from JSON file
Most of the code is unit tests for toolchain creation.

Change-Id: I955ba49db38acf6f9e35d366280b710ea0466655
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-04 12:42:55 +00:00
Piotr Mućko
a3fbfac814 McuSupport: Automatic memory management for mcu sdk
Fix crash while automatically restoring kits during startup.
Change packages container to set to avoid duplicates.
Use RAII for McuSdkRepository.

Change-Id: I4b3f4156f0bc770c8a5ea8a171b1f22f6ffb8f96
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-01 13:55:34 +00:00
Eike Ziller
b6f679d777 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/webassembly/webassemblytoolchain.cpp

Change-Id: Ia75c783e3ecab1f97de2b5c73a0979c49da82009
2022-03-18 16:07:51 +01:00
hjk
a23c4ce014 Docker: Fix searching compilers in custom directories
Previously, detection (mostly) only used path.

Change-Id: If382205c2ff39cabfe21953e877e152dc952a84c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-18 08:21:51 +00:00
Christiaan Janssen
e293aab725 McuSupport: remove cmake mapper
Starting with Qt For MCUs 2.0, environment variables are not
used to track dependencies any more, but cmake variables are.
Due to time constraints, we implemented a env-to-cmake mapper
to cover that gap at the moment. This patch removes that hack
and implements tracking dependencies through cmake variables.

Task-number: QTCREATORBUG-26904
Change-Id: Id8553a764d212d9b12e4adc54fc56233bfeb9a5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-11 14:24:34 +00:00
Eike Ziller
cd8c4ced81 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ic02df53b880d0861d9d9ea0df3e0d381ae99f350
2022-03-11 09:50:48 +01:00
Christiaan Janssen
75dd1c2251 McuSupport: fix issue with resolving relative paths
FilePath::resolvePath accepts a FilePath param, but treats
leading hashes as indication of an absolute path.
FilePath::pathAppended only accepts QString,
but understands that the param is always a relative path.
In our case we always want to treat the paths as relative.

Change-Id: Ib23c27e76500de8a89d9dd22cd7efb95a9bd4d6d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-10 09:23:55 +00:00
Piotr Mućko
a49c029056 McuSupport: settings unit tests
Change-Id: I0fe1b8f9523f952e14a23c7ffa9ef7d3b6ff6ddf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-10 08:44:20 +00:00
Christian Kandeler
52e26a360b Fix newly introduced warnings
Change-Id: I0b9cf3496d536e1173fbd6587e5b491305eb876c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-23 15:26:31 +00:00
Christiaan Janssen
7d9bb3f7e8 McuSupport: refactor McuPackage
rename 'type' to 'toolChainType' in McuToolChainPackage
'addToPath' and 'relativePath' set in McuPackage constructor
put McuToolChainPackage methods together in same source file
'detectionPath' type changed from QString to FilePath
renamed boolean getters

Task-number: QTCREATORBUG-26897
Change-Id: If59c299901a169d08efa8f39614ef7c6d48d44ed
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-22 13:48:54 +00:00
Christiaan Janssen
e4da779653 McuSupport: move auto-kit-creation option to McuSupportOptions
It was part of McuPackage, and only used by the SDK instance.

Task-number: QTCREATORBUG-27093
Change-Id: I9d9eaac621e9997129c227fae3ac88b502ba4340
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-22 07:15:33 +00:00
Christiaan Janssen
2834e90930 McuSupport: split mcusupportoptions
Several independent classes were mashed together in mcusupportoptions.cpp
This patch moves McuToolChainPackage together with McuPackage,
McuTarget to its own header+source pair, and
McuKitManager to its own header+source pair.

Task-number: QTCREATORBUG-26890
Change-Id: I0b51da4e1cae5a976201dffd290a665eaa318b33
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-18 09:14:29 +00:00
Piotr Mućko
76453511cc McuSupport: plugin code formatting
Change-Id: I2d1c3dfad3fddce7706056997d284292e13d3ad2
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 27cadc86ba)
2022-02-16 11:18:28 +00:00
Piotr Mućko
7fedb56c65 McuSupport: make package status enum class
Change-Id: I6d52e8e25e9934683371246ba05612f4f17450c1
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-16 09:20:31 +00:00
Erik Verbruggen
34345f8b7e Make McuToolChainPackage::Type an enum class
And make more use of switch statements without a default case, so each
type is handled explicitly. (Ok, there is a default, but that is
Q_UNREACHABLE).

Change-Id: I30ccc447e55a5aeebebe1a9879ea3136545f5e68
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
2022-02-10 08:52:59 +00:00
Erik Verbruggen
32f8ed7b66 Make (and return) more properties as const-ref in McuPackage
This implies that those properties are now passed into the constructor,
and their setters are removed.

Change-Id: I34b4d9d7450897e6a7a72b8edaffdc05961546d1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
2022-02-10 08:52:45 +00:00
Erik Verbruggen
6b6b35f59e Move MCUPackage and MCUToolChain package to separate files
Also move `packagePathFromSettings` so it can be used from multiple
places. This function will probably move into a separate utility file
in future changes.

Change-Id: I208a5a7bc8aa689829178809a1f4053a961d93be
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-10 08:52:23 +00:00