Commit Graph

126 Commits

Author SHA1 Message Date
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
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
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
250f4fb72f McuSupport: Move McuDependenciesKitAspectWidget into its own file
Change-Id: I41a2a6ec48c5c02ca655cb09ad08080d73d336fe
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-10 20:42:59 +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
5cfe69b049 ProjectExplorer: Use a struct for toolchain autodetection parameters
Also, make some functions const and use an alias for QList<ToolChain *>.

Change-Id: I6a1cbcb79bfaa9d252c4b69e00aa93e5d0dabe2f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-18 11:25:34 +00:00
Christiaan Janssen
b3a77eca26 McuSupport: IAR compiler registration
Autodetection of IAR compiler relies on Windows Registry.
On Linux, without registry we can't autodetect it.
This fallback accepts the user-entered compiler path.
The McuSupport plugin already implements a basic check
that the expected compiler binary is in the given path.

Task-number: QTCREATORBUG-26753
Change-Id: I43ce68f4bc075e60a2f4cd0d906f8389dc0fdfd7
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-13 07:41:04 +00:00
Christiaan Janssen
b4eb6ff4dd McuSupport: fix armgdb registration when creating kit
Task-number: QTCREATORBUG-26631
Change-Id: Ia1854ba2a4d34afff1d2c80aac4c9919cd3142dc
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-12-01 11:32:46 +00:00
Christiaan Janssen
51c2ee8714 McuSupport: fix false positive when detecting upgradeable kit on Windows
Cause was: mismatched slashes-vs-backslashes in path comparison

Task-number: QTCREATORBUG-26584
Change-Id: I74ec18d33b8138ecc75a5b4928bd67f856b4c4c1
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-18 16:50:11 +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
Oliver Wolff
08b6e0239f Add support for MSVC2022 (Preview)
2022 should be binary compatibility with previous versions (see
https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-160).

Change-Id: I4200f0c7d78adb0d1f352cd527c0f6041a1f5283
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-04 12:02:36 +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
Alessandro Portale
f88c885d44 McuSupport: FilePath::fromString -> fromUserInput changes
Prevent non-portable dir delimiters from getting into a FilePath.

Change-Id: I78e4a98e03ffe95e3cef70c9c499af28fa33c25c
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-28 07:12:13 +00:00
Leena Miettinen
c9e89d4844 MCU: Fix UI text
Task-number: QTCREATORBUG-25915
Change-Id: Ia6505f1ec0fd8ebb879ca21e1b3bf140db9e9538
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2021-07-05 06:35:12 +00:00
Erik Verbruggen
943c31a5b4 Fix missing checks for GHS-Arm
Some places where ghs-specific checks were done, were not modified to
do the same for ghs-arm.

Change-Id: I484f98209188e4c160a13248ca3c3f046b342b22
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-31 14:52:02 +00:00
Erik Verbruggen
3ed6f58056 Change the generator for the GHS and GHS-Arm compiler to Jom
Using Ninja not all modified files will be compiled in an incremental
build.

Fixes: UL-4247
Change-Id: I0bdb1e611e54ea6674ccae4d23391ac86f0960b8
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-20 14:04:10 +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
hjk
509f40825a ProjectExplorer: Pass device to ToolChain::autodetect
Currently unused, will be useful to detect toolchains in docker
containers.

Change-Id: I0fd7643969ab02c05839332a436147ffb242635d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-28 07:59:45 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
hjk
77481f25ce ProjectExplorer: Base KitAspectWidget on BaseAspect
Enables re-using existing functionality.

The "Make mutable" functionality is still oddly placed. I doubt people
find and use it actively.

Change-Id: Ic6aae17e3a7df093f0f5f234f1e6e1afc196a087
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:02:19 +00:00
Christiaan Janssen
d6cc05f0ea McuSupport: fix manual creation of kits
Kits are marked as 'manual', so that user has individual control of each one.
'Remove' button replaced with 'Update' button for manual update.

Task-number: QTCREATORBUG-25259
Change-Id: Iadf5f2da3ef7bee7fb051516ffda7fcefe8b56d8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-14 10:07:50 +00:00
Christiaan Janssen
af24cad00f McuSupport: update dependency paths of kits if changed
Task-number: QTCREATORBUG-25488
Change-Id: I529b6243b799e35db5e9804087e4ed20224cb024
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-14 09:59:39 +00:00
Christiaan Janssen
5dcf2ba0fa McuSupport: manage kits for different SDK versions side-by-side
Task-number: QTCREATORBUG-25044
Change-Id: I6fbadd1e4192e9958ec4bb1a5bbbfe82c168fc2d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-31 07:30:08 +00:00
Erik Verbruggen
2361f26732 Support merged QML import paths with header paths
QUL does not have separate QML import paths, but (re-)uses the include
paths for this purpose. Support this behavior by adding all include
paths to the QML import paths before handing the project information off
to the QML code model.

Change-Id: Ic2e39ab69ac27776f5070b7b8b7c66d53a83210b
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-18 14:33:55 +00:00
Christiaan Janssen
edba0ca838 McuSupport: track if kit dependencies go missing
Task-number: QTCREATORBUG-25262
Change-Id: Icf95a418216ae94fcfc76784a10eb23e403f3d52
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-15 07:25:17 +00:00
Erik Verbruggen
9d90efee8b Add QML import path supplied by the kit
Although QUL has merged the QML import paths and the include paths, the
convention for C/C++ is to have the headers for a project under a
subdirectory of the include path, and do imports relative to the include
path. For example:
  #include <qul/SomeHeader.h>

The QML code model doesn't know about this convention, so for the kit
has to supply an extra QML import path for this case.

Change-Id: I82d4375dd8a1f510180f81b011a715dee8c10d60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-10 14:33:06 +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
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
Erik Verbruggen
7dc82b1af9 MCU: Do not add fall-back path for QUL kits
Fixes: UL-3609
Change-Id: I9912c7476f3b45346835d60be61fed7399046162
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 10:33:52 +00:00
Erik Verbruggen
3b1bc1d053 Add Qt for MCUs examples to the welcome page
Fixes: QTCREATORBUG-25320
Change-Id: Ic770e55f41b50d384f9964cabfa7ef031dcacc13
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-10 13:14:55 +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
Orgad Shaneh
dad2b3d84b Merge remote-tracking branch 'origin/4.14'
Change-Id: I7d55c01489dfcdd26fcf3ced9f26539a09073e8c
2021-02-08 12:56:36 +02:00
Alessandro Portale
c25afb1b59 McuSupport: Remove explicit appointment of Jom as CMAKE_MAKE_PROGRAM
Detecting the presence of Jom, setting CMAKE_MAKE_PROGRAM to it and
choosing "NMake Makefiles JOM" as CMake generator was implemented in a
time where the Qt SDK did not yet ship ninja.

By now, ninja is shipped and it *should* be automatically installed as
dependency of Qt for MCUs. Qt Creator will by default prefer ninja as
generator/buildtool if it is installed.

Task-number: QTMCU-18
Change-Id: Ia83ac3a454b90bb5b5b69ddefb3fbb8f23fa15c9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-04 15:27:58 +00:00
Eike Ziller
b54ab67705 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: I337d1b86f54ad4433a3ed0d73e2011654ef6b950
2021-02-02 12:20:00 +01:00
Christiaan Janssen
70670cad23 McuSupport: Do not add clang to PATH when creating a new kit (1.7+)
Fixes: UL-3591
Change-Id: I7ec618aeb28bb8e79733267056d5c4c0ff7ba382
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-02 07:34:52 +00:00
Eike Ziller
1283b15117 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	doc/qtdesignstudio/examples/loginui1/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui2/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui3/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui4/qtquickcontrols2.conf
	share/qtcreator/debugger/dumper.py
	share/qtcreator/debugger/qttypes.py

Change-Id: Id44a67cdeeb0889ff96eddcdf409d20ca7cbdd0b
2020-12-10 13:02:02 +01:00
Alessandro Portale
df482e27b7 McuSupport: Identify kits also by toolchain
Fixes: QTCREATORBUG-25052
Fixes: QTCREATORBUG-25053
Change-Id: I87e51fbdb8d01cb564574f996bdfb51420f28584
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-08 15:06:02 +00:00
Eike Ziller
3f0e7bcbe1 Merge remote-tracking branch 'origin/4.14'
Change-Id: I9d1931b7862f4541ac7a064ff987128afd835cbe
2020-12-07 12:29:44 +01:00
Alessandro Portale
79c4df1ea1 McuSupport: Register all .qch files in the SDK's docs/ directory
Instead of having a hard-coded list of .qch file names to register,
register all .qch files that are present in the Qt for MCUs SDK's docs/
directory.

Turning docs registration into a self-maintaining feature.

Fixes: QTCREATORBUG-25043
Change-Id: Idc7afb78b256bcbb3e8cd7f80fab6a356eb47aa3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-04 17:58:38 +00:00
Eike Ziller
41b73594ad Add API for saving settings with default value
We should never actually write default values into the settings, because

- if the default value changes in a later Qt Creator version, the new
  default should automatically take effect if the user didn't change the
  value
- it senselessly grows the settings file

Add a QtcSettings class that extends QSettings by a
"setValueWithDefault" method, which does not write default values to the
settings, and actually removes the settingskey if the user switches back
to the default.

Use it at the places where we already do this manually.

Task-number: QTCREATORBUG-24762
Change-Id: Ia76414cb21e8521f3aeed1e37b43ae4fb3393ea3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-04 08:25:17 +00:00
Eike Ziller
8245523653 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/designer/cpp/formclasswizard.h
	src/plugins/designer/cpp/formclasswizarddialog.h

Change-Id: I9f9d166e1a9249022305503f9cbe571136c2a2b1
2020-11-25 11:25:34 +01:00