Commit Graph

80 Commits

Author SHA1 Message Date
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
Erik Verbruggen
1d63eaee23 Change two paths from QString to FilePath
Fixes: QTCREATORBUG-27144
Change-Id: I41ecc2e96b61a5a8383ef710b558f65e93c5b591
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-07 12:26:57 +00:00
Piotr Mućko
566cea1b60 McuSupport: Update test json files to new format
2.1 is released hence uses legacy creation of packages.
McuSupport refactoring is part of QtMCU 2.2.
Will be finished before qtc 8.
It will be documented before 2.2 and qtcreator 8.

Change-Id: Iab0e85f27186149cb73456983d15b30401d99233
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-04 13:03:52 +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
50fddf1128 McuSupport: 2.2 does not use legacy implementation
Change-Id: I77ba78f8997f1727de5b39cc49811e1def4287d5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-01 14:06:50 +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
Christian Stenger
162fc2708c McuSupport: Fix qbs build and build with Qt5
Amends 8c04c2ea55.

Change-Id: I27f2c900cddfd79b52d4989fa321e6f86177c89e
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-03-21 10:13:46 +00:00
Piotr Mućko
88342a6bba McuSupport: chop RTOS environment variable suffix
Change-Id: Iba35246af403a00bd0f750e3769e22a5010825eb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-18 11:35:46 +00:00
Piotr Mućko
8c04c2ea55 McuSupport: Introduce new implementation stub
New/legacy implementation will be chosen based on contents
of input json file.

Change-Id: I989fa667c43123f831cc77320684413cab7652df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-18 08:38:43 +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
Piotr Mućko
9697e3407f McuSupport: extract target factory
Change-Id: I1ba16ecdc15bdad970b522bea8787b316e19ae58
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-10 08:43:59 +00:00
Eike Ziller
41538832c3 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/libs/utils/qtcprocess.cpp
	src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
	src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp

Change-Id: Id0c31719e46d1c44770ea89663eee321a0517ff4
2022-02-24 11:42:57 +01: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
Eike Ziller
8259df00d0 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/mcusupport/mcupackage.cpp
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/mcusupport/mcusupportoptions.h
	src/plugins/mcusupport/mcusupportoptionspage.cpp
	src/plugins/mcusupport/mcusupportplugin.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: Ib423e9f23877176f01b188104b0a179ed32c4770
2022-02-22 14:06:41 +01: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
Erik Verbruggen
c755de0823 McuSupport: Move kit methods out of McuSupportOptions
... and into McuKitManager

Task-number: QTCREATORBUG-26890
Change-Id: Ic5ed689458d3ef004ebb42a549c48a6326c2f45d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-17 10:41:59 +00:00
Christiaan Janssen
6e96480154 McuSupport: remove legacy support for 1.x SDKs
Task-number: QTCREATORBUG-26891
Change-Id: I011649b051c6c4c9b954b1c782685e404c3796fe
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-16 13:50:14 +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
Eike Ziller
49ecd64b9c Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/docker/dockerdevice.cpp
	src/plugins/mcusupport/mcupackage.cpp
	src/plugins/mcusupport/mcupackage.h
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/mcusupport/mcusupportoptions.h
	src/plugins/mcusupport/mcusupportoptionspage.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp
	src/plugins/mcusupport/mcusupportsdk.h

Change-Id: I8c8f5953a21729ba9178dbc44ed613eed131a0c8
2022-02-16 10:59:04 +01:00
Piotr Mućko
b1f35bf905 McuSupport: Extract target description to separate file
Change-Id: Ia79d64b5b5a752bdacb404b49e8ac78c2d32ee4e
Reviewed-by: hjk <hjk@qt.io>
2022-02-15 13:53:28 +00:00
Piotr Mućko
27cadc86ba McuSupport: plugin code formatting
Change-Id: I561bd66431ff3da7819bb9b2ff780197b5593708
Reviewed-by: hjk <hjk@qt.io>
2022-02-15 11:50:33 +00:00
Piotr Mućko
9917166b2e McuSupport: basic test & required refactoring
Introduced Package interface for mocking purposes.
Made some functions visible in headers for testing.
Added basic test skeleton for mcu plugin.

run cmd: `qtcreator -test McuSupport`

Change-Id: I1011d49052bd8c894da393d8a285b241682f1f94
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-15 11:03:30 +00:00
Erik Verbruggen
93fc6b5c3c McuSupport: Make all member fields of McuTarget const
In proactive, the color depth was never changed after setCMakeOptions
was called. This change makes it clear that it is also not intended to
be changed: a board does not suddenly change color depth, and for a new
board configuration a new target is created.

Change-Id: Ie5b99726d833efcdf129655b8e70120a033914e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-10 21:19:07 +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
hjk
1fc83d2a56 Utils: Wrap various file system iteration flags and filters
... into a single class.

This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.

Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-26 13:13:41 +00:00
hjk
f9c97d23c7 Utils: Add optional recursion for file system iteration
Change-Id: Icded897b129aebd7132376cff55717e16dffc040
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-18 11:52:29 +00:00
Christiaan Janssen
6b3191c11e McuSupport: support for Renesas Flash Programmer
Task-number: UL-5082
Change-Id: I1eb4583fa2635adfc302f878301152c2358de446
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-12-09 08:55:27 +00:00
Christiaan Janssen
da10ed2483 McuSupport: skip error when failed desktop fallback
On 1.x SDKs, if the desktop kit description is missing
we still create a desktop target from a library that is
distributed with the SDK, through a fallback function.

On 2.x SDKs, the library has been renamed, but we don't
want to create the fallback. The kit description is
mandatory. Therefore, we shouldn't show the error
for failed fallback.

Task-number: UL-5092
Change-Id: I469269b2286d33f0f13335eef09ea2467c59be2e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-12-08 16:05:59 +00:00
Christian Kandeler
b2d63bf79e Fix various compiler warnings
Change-Id: Ib64f04f154b2c44dad3248ef038449c2ac628686
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-02 15:48:52 +00:00
Christiaan Janssen
4a50a582e7 McuSupport: default paths for 3rd party dependencies left empty
If QtCreator is installed via the Qt Installer, sensible defaults are
provided at installation time. For not provided software, $HOME
is not a useful default. Leaving the field empty signals the
user that they need to provide one manually, more clearly than
providing an invalid path.

Task-number: UL-4939
Change-Id: I8ef79e563366ebdbea53df8183a1eca82bd7be4a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-11-25 07:51:12 +00:00
Christiaan Janssen
983ca3106d McuSupport: avoid double-space strings in warnings
Change-Id: Ia40412154662ce9a22ae569c9f8abf31b419cbce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-15 10:23:17 +00:00
Christiaan Janssen
0eeb6c6e5e McuSupport: support for SDK 2.0
This is a quick fix for the current situation. Proper
support will need a rewrite of part of the plugin code.

QtQuickUltralite SDK 1.x relies on environment variables
for the dependencies. SDK 2.x uses CMake variables for that purpose.
Some of the variables have been renamed, others grouped together.

Here a mapping between those is hardcoded as an urgent solution.
A proper implementation should make the plugin independent of
the existence or lack of specific environment variables. Also,
all the hardcoded information needs to be moved to the json kit
files in the SDK. Otherwise, compatibility breaks between versions
every time the built-in assumptions relating to that information change.

Task-number: UL-4396
Change-Id: I7f40a694a773881f20b29bae9d02c7c1c8bd747b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 16:00:30 +00:00
hjk
93a07e1c6e Mcu: Proliferate FilePath use in McuSupport
Change-Id: I0ae8bf1454d1715f251d88065b52e3bb6a242402
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-05 08:47:00 +00:00
hjk
bd4a501f15 Replace some uses of HostOsInfo::withExecutableSuffix with FilePath
Change-Id: Id72e9fd04dd4995ff2775ee919f747018cbcc339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 11:48:48 +00:00
Eike Ziller
2485c31a48 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc

Change-Id: I906330addb7de31e6ed88f88af3fd2adbbe53e1f
2021-05-31 16:13:47 +02:00
Christiaan Janssen
4616c134aa McuSupport: default path for STM32CubeProgrammer for non-Windows
Task-number: QTCREATORBUG-25788
Change-Id: If29351eaee6f14315df2a2471d2de4c254ef1c8a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-27 08:00:56 +00:00
Erik Verbruggen
d98feae8f6 Add support for the Cypress traveo II kit
Fixes: UL-4242
Change-Id: I0b492a3edd6a1dce9d214e6490e174050c3fdb30
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-20 14:03:05 +00:00
Eike Ziller
4151f091e3 Merge remote-tracking branch 'origin/4.15'
Change-Id: If0dbebdf37b0ffea2528bf6ce6d34d88554f8dfb
2021-03-16 10:55:54 +01:00
Christiaan Janssen
2aead8b3e4 McuSupport: detect fallback lib when desktop kit missing
The library filename has changed in recent versions of the
SDK, which was causing false negatives.

Fixes: QTCREATORBUG-25469
Change-Id: Ie98c75a57efc5384262dbfd17f729b34cdd5f577
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
2021-03-15 12:10:45 +00:00
Christiaan Janssen
b5781e6028 McuSupport: Improvements with version detection
Task-number: QTCREATORBUG-25261
Change-Id: I1b378eb4a4d132b64e4c36e0a0cdafd402570785
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-09 08:31:16 +00:00
Christiaan Janssen
65215b01e8 McuSupport: Better management of older Qt for Mcu SDKs
Task-number: QTCREATORBUG-25337
Change-Id: Ib0b2f6c75a41a2a897c128455c7b6f761832f5d4
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-04 10:12:25 +00:00
Christiaan Janssen
3e08210998 McuSupport: Detect dependency versions when building MCU kits
Task-number: QTCREATORBUG-25261
Change-Id: I79d24aa2e26a3f647bd2251c0407c7d09eea73b3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-02 14:36:40 +00:00
Christiaan Janssen
4b6f1c1366 McuSupport: Display errors when generating kits automatically
Fixes: QTCREATORBUG-25260
Change-Id: I5e45a56d08920886b2f654a1c98a7451e1c9dc3f
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-10 09:29:56 +00:00
Christiaan Janssen
5b7a3fba27 McuSupport: Display errors when configuring Qt for MCUs SDK
Fixes: QTCREATORBUG-25258
Change-Id: I6f445bddb51f3bc1850793966f049c4b7ce7889f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-02-09 13:10:07 +00:00
Jarek Kobus
cf010911f7 Don't allocate unneeded temporary containers
Fix clazy warnings: allocating an unneeded temporary container
[clazy-container-anti-pattern]

Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-14 12:35:47 +00:00
Dawid Sliwa
3929917ecb McuSupport: Add support for kits with IAR compiler defined
- added IAR toolchain factory similar to ARM GCC one
- extended kitName with used compiler name
- added Unsupported toolchain type to fix crash after creating kit with not
  recognized toolchainID

Fixes: QTCREATORBUG-24898
Change-Id: I28b8376ca4bc88d3d75e17bd242ac49f0ee09845
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <christiaan.janssen@qt.io>
2020-11-20 12:50:11 +00:00
Jacek Nijaki
08541305b6 McuSupport: Add support for desktop backend JSON file
Starting from Qul 1.5 json kit file will be shipped for desktop platform.
This change is backward compatible with previous Qul version - if no
desktop specific json file is found a legacy code is executed.

This change removes "desktop" toolchain, instead "msvc" and "gcc"
toolchains are introduced.

Additional parameter was introduced to the josn kit file: "platformName"
which enables using different strings in kit name and in QUL_PLATFORM
cmake variable.

Change-Id: Ie0a212aaad47a8033e9a81467f60a23c2bc19a51
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-09-22 08:32:00 +00:00
hjk
bedf7d74a4 Mcu: Extend workaround for missing JSON file for Desktop target to Linux
Amends 08fe165ab586e6.

Change-Id: I3c3d205f083a3b59ac0490bf7ff22f12fb613b62
Reviewed-by: Jacek Nijaki <jacek.nijaki@siili.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-08-20 15:03:37 +00:00