Commit Graph

198 Commits

Author SHA1 Message Date
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
hjk
1c4f973365 ProjectExplorer: Replace the fromMap error return value
... by some out-of-band mechanism, keeping previous functionality.

The driving reason is to get the same fromMap signature as in the
AspectContainer base, however, the whole mechanism seems rather useless:
There are only a few places that actually ever could report errors,
in those places "moving on" looks ok, too, and these few places
are not conceptually different than a lot others.

Removal of this (new) mechanism is left for later.

Change-Id: Ibe7a0456bc3b84a84e942231f14446e783372d76
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-24 06:31:51 +00:00
hjk
53d06feecd ProjectExplorer: Change ProjectConfiguration::toMap signature
To match better with the rest, especially the base AspectContainer.

Change-Id: Ide0966cab3219800aa6b7b9e6012731a3fbe7a6f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-21 16:12:15 +00:00
Eike Ziller
ac0796926d Merge remote-tracking branch 'origin/11.0'
Change-Id: Iaa647a44accc98ae84aa095d0bd5049588a92387
2023-07-14 14:51:22 +02:00
hjk
f7afa52106 CMake: Use aspects more directly in CMakeBuildStep
Change-Id: Id12381556439ef6b3e56307a169830bb18da9003
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-14 07:25:06 +00:00
Jarek Kobus
47ac604aea AbstractProcessStep: Use task tree for all subclasses
Introduce AbstractProcessStep::runRecipe() virtual method
with the default implementation.

Task-number: QTCREATORBUG-29168
Change-Id: Iac75f4c38f8ee91ad8ac9324bb27881a3722911f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 06:48:58 +00:00
Alessandro Portale
733279e017 CMakeProjectManager: Deselect "Stage for installation" for WebAssembly
There is no CMake install target for WebAssembly. Therefore, the "Stage
for installation" option needs to be deseleceted, like it is being done
for Android and iOS.

Amends: 2387e9e37a

Fixes: QTCREATORBUG-29293
Change-Id: I954dc492259b7211d3dc68047dbb6d7a8e6579b9
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 05:22:58 +00:00
Jarek Kobus
2cc3c3b681 CMakeBuildStep: Employ task tree for running
Remove emitting 100% progress on finish, as that's
done automatically by the task tree.

Task-number: QTCREATORBUG-29168
Change-Id: I468fd2c12ffda4c051a46e586fc18214598269f9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-13 09:53:54 +00:00
Jarek Kobus
b37b94f0e5 AbstractProcessStep: De-virtualize finish() method
Provide a setDoneHook() setter instead. The hook is
introduced temporarily, as when all the subclasses
are transformed to use the task tree, the done hook
is going to be a part of the subclass' recipe.

Task-number: QTCREATORBUG-29168
Change-Id: Idbc0f8b8a32c8df2fa5ecb73ed1cbaedad99620d
Reviewed-by: hjk <hjk@qt.io>
2023-07-13 06:50:07 +00:00
Marcus Tillmanns
d18768b53a CMakeProjectManager: Use more FilePath
Change-Id: Ifa3e754c224cd6ec315d49cd825aa78ac59b5ad9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-07 07:08:36 +00:00
hjk
98bba063b6 Utils: Use FilePathAspect::setDefaultValue
... instead of StringAspect::setDefaultFilePath.

Closer to the intended uniform access.

Task-number: QTCREATORBUG-29167
Change-Id: I87df385ef98873a0955010149a9a9b09a5f29daf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-30 09:34:26 +00:00
Alessandro Portale
2387e9e37a CMakeProjectManager: Deselect "Stage for installation" for Android/iOS
The "Stage for installation" option in the CMake build step, which is
introduced with Qt Creator 11, relies on the presence of an "install"
CMake target.

The build systems of Qt for Android and Qt for iOS do not create an
"install" CMake target. Therefore, a pre-selected "Stage for
installation" option in the CMake build step would cause a build
failure.

This change deselects the option if the kit's run device is of type
Android or iOS.

Fixes: QTCREATORBUG-29293
Change-Id: I9755dea1564fbc2696f8bdd416f637c5b28e3761
Reviewed-by: hjk <hjk@qt.io>
2023-06-20 12:26:04 +00:00
Eike Ziller
f97d9e51c0 CMake: Use QtC temporary dir for staging directory for local builds
For builds on the local host, use the Qt Creator temporary directory as
the default "staging" directory. This is a "nicer" directory on Windows
and is also cleared automatically (at Qt Creator shutdown), which is not
true for "/tmp".

Amends 4753b658bb

Change-Id: Ia6dc0d76fb2d97eb7ec931981df057ec83553e69
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-20 08:23:09 +00:00
Eike Ziller
3825b9f2cc CMake: Some UI/tr fixes
Avoid the order "Label [ ]" for checkboxes, we changed all cases to the
standard "[ ] Label" because it looks very ugly and confusing the other
way around. Also move the corresponding directory setting to the next
row, which is not ideal but still looks better.

Improve message about reloading presets.

Change-Id: Ibcd26e24a2a4cd3ea5ca819f74e78edb40f46072
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-15 10:02:36 +00:00
Eike Ziller
ea8182016b CMake: Fix command line for "staging" an installation
Fix that the "install" target was added too late in the command line
arguments, leading a cmake error for multi-config setups like for iOS.

Change-Id: If35a96725f55b5d250ccdd7386ba02d7a21ede85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-14 13:53:45 +00:00
hjk
75710fa369 Utils: Remove LabelPlacement::AtCheckBoxWithoutDummyLabel
This is identical in remaining functionality to AtCheckBox after
the recent layout builder changes (or rather, can be adjusted on
the layouting side by having appropriate empty cells)

Task-number: QTCREATORBUG-29167
Change-Id: Ic357de6fb756acb5926afe1fd361ee4b18b17afd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-24 09:53:05 +00:00
hjk
3ecaabf5e9 CMake: Use a FilePathAsepect for the staging directory
Change-Id: Id4ac0cdaa3a773f740f474e78a7af104996a5504
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-23 12:54:37 +00:00
hjk
5e059db065 CMakeProjectManager: Robustify buildAndRunOnSameDevice helper
Change-Id: Ib3559f81f2ff71ad5fc04d982ad6286df0d4390e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-22 12:48:27 +00:00
hjk
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +00:00
Eike Ziller
66c0c36bc1 Fix compiler warnings
Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 09:05:16 +00:00
hjk
b7ca84c5ee Utils: Remove one LayoutBuilder::addRow() overload
The flexibility here is getting in the way later when trying to
remove the dependency on aspects.

Change-Id: I7221e80f2067292c7c80aead8f6d739fb7878f7e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:07:26 +00:00
hjk
4753b658bb CMake: Allow to run staging installation in CMakeInstallStep
User configurable, on by default (only) for cases where build and run
device are different.

The staging dir is by default a randomly named directory on the build
device, but can be changed by the user if needed.

Overall, this does not change anything for a pure local setup (but
would let the user opt-in into staging, too)

Change-Id: Ic1c5fd1f1261e067692710c9e3aa9d821897478d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 10:07:37 +00:00
Marcus Tillmanns
ca0bee902f ProjectExplorer: Create BuildDirectory on device
The BuildDirectory is now assumed to be on the build device.

The default build directory template path is resolved against the
project path mapped to the build directory.

Change-Id: Ie1d147d135e9e551f2ac46cbec583374d524d2d7
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-04 12:17:49 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
Alessandro Portale
226799858c Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over
QCoreApplication::translate("::<Module>", "..."). This changes
occurrences in .cpp files.

Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:37 +00:00
Alessandro Portale
9db70d8810 Translations: Fix stray QApplication::translate() calls
For references to the module-own context, use Tr::tr().
For references to other modules, use the right context name (with "::"
prefix).

Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-08 08:32:42 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
ea35ed9ffe AbstractProcessStep: Merge finish() with processFinished()
Change-Id: Ied15ec3ee9d3bcc80b03b2589d101c65f2fd062a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-05 08:43:21 +00:00
Cristian Adam
a0afd51f3f CMakePM: Add "CMake Install" deployment step
This commit adds a "CMake Install" deployment step, which is using
"cmake --install" command.

"cmake --install" command has been added in CMake 3.15, this is why the
minimum CMake version has been updated to 3.15.

Note that CMakeBuildSystem::makeInstallCommand is still using cmake --
build --target install due to a CMake bug regarding "Ninja Multi-Config"
generator, which doesn't intall all binaries via "cmake --install".

Fixes: QTCREATORBUG-25880
Change-Id: I504674c380055d8ef136d344a78b80c17ecf9765
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-19 13:57:43 +00:00
Jarek Kobus
7cf6d9c97b CMakeBuildStep: Get rid of m_waiting field
Change-Id: Iea737960f57e93fa1e688ed43eedf1bf44204709
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-06 14:24:46 +00:00
Jarek Kobus
55284ba124 CMakeBuildStep: Don't use stdError
Emit addOutput() signal directly. This will add a newline after
the message. Use OutputFormat::ErrorMessage instead of
OutputFormat::Stderr.

Change-Id: Id5e95dd00dca5e57b67c583a1b11071bf4101880
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-02 16:38:25 +00:00
Jarek Kobus
dfd079f050 AbstractProcessStep: Merge virtual functions
Merge processSucceeded with processFinished into one virtual
function. Leave default implementation empty, so that
reimplementations don't need to call base impl. Move
processFinished into private section. Pass just one bool success
parameter into processFinished.

Change-Id: Ide3e262de0c0c5583c9fec2426fa460b6b74a49d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-02 15:37:16 +00:00
Jarek Kobus
02f384115e Remove unused includes of QBoxLayout
Change-Id: I74204eaf70dbcb31a8bd13609bef35459c8c6b5f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:29:29 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
3b84a408df CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:46:51 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Cristian Adam
e02f4a0518 CMakePM: Add support for build CMake presets
This patchset will add support for version 2 of the CMakePresets
feature that has been implemented in CMake 3.20

https://cmake.org/cmake/help/v3.20/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I08934243cc04487d38c4b59c2ad4a4a8d0484492
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-28 21:24:53 +00:00
Alessandro Portale
528c44ba8a CMakeProjectManager: Remove margins around CMakeBuildStep widget
Change-Id: I9b2a1a615f987c3dff9b5fcb29b0a10c5417f752
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-16 05:57:37 +00:00
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
hjk
2496ffe3ce Code cosmetics
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>
2022-06-24 14:44:13 +00:00
Alexandru Croitor
b72d5b05f8 CMake: iOS: Enable automatic provisioning updates
By default xcodebuild does not try create / download a provisioning
profile for a project if a valid one does not exist locally
in ~/Library/MobileDevice/Provisioning Profiles, even if the
Xcode CODE_SIGN_STYLE attribute is set to Automatic.

Starting with Xcode 9, xcodebuild accepts a new
-allowProvisioningUpdates option.
When passed, xcodebuild will request a new provisioning profile
from Apple's servers for the current project and use it during
the build. The provisioning profile is only needed when building
for a real device, not the simulator.

When building an iOS project with qmake, the option is embedded in the
wrapping Makefile generated by qmake, so Qt Creator can simply call
make (which it does).

For CMake, there is no wrapping Makefile, so we need to pass the new
option explicitly as an additional build tool argument.

There might be cases where automatic provisioning is not desired,
which is why there is now a new checkbox in the CMake build step
configuration widget. It's default value is 'enabled', to match
qmake's behavior.

As an implementation detail, isiOS had to be moved to a header file so
it's accessible to both the build configuration and the build step.

Fixes: QTCREATORBUG-26246
Change-Id: Ic80cd965ba095d0ff379e13ad2ffb8c298c9f7c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-09 09:52:18 +00:00
hjk
ebf3144f22 CMake: Shift remaining data to buildsystem
Change-Id: I04518a21ce571399c89608d2e59e746f8e6e0d4a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-05 12:10:28 +00:00
hjk
33a385c4d6 CMake: Shift multiconfig storage from build config to build system
Change-Id: I6f9b6c590975caeea4ad92c61f354d81d4d90431
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 13:35:30 +00:00
Eike Ziller
531f3ada2c CMake: Add xcodebuild parser for "Darwin" targets
Similar to the qmake make build step, so build issues are parsed for iOS
builds.

Task-number: QTCREATORBUG-26541
Change-Id: Ie71a3087feab2720f6d8b4974d221a70c3fe76fa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-16 13:02:33 +00:00
David Schulz
665285b981 Docker: Map build directory to device in cmake calls
Change-Id: Ibcd2e1aebac337e880a28a2a22b35d8ca60b6dcf
Reviewed-by: hjk <hjk@qt.io>
2021-10-26 07:38:55 +00:00
Cristian Adam
a88f1426c3 CMakePM: Populate targets list on add new build step
The target list was recreated when the parsing of CMake project
finished.

But for already configured projects, the list was not used when
a new build step was added. This new step will only get the
targets list when the CMake project would be reparsed.

Fixes: QTCREATORBUG-25759
Change-Id: I54d12a71dacf9fcec2ad0f3e341fe8057880251d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-16 16:35:55 +00:00
Assam Boudjelthia
cd20ad8ff4 Revert "Android: add prepare_apk_dir CMake target by default"
This reverts commit 9dcbb8ca01.

Reason for revert: This workaround is not needed anymore, since
Qt 6.1.2 (see 71348437939e62b0e3b86888e966b300ff1e2855).

Change-Id: I089457dc58c5b97136b30190fdf17cfb303f8bd8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:29:10 +00:00
hjk
d632b3eb4f CMake: Use local builddir path when constructing cmakeCommand
The command will be executed on the build device, from that perspective
the builddir is local.

Change-Id: I9b3bdf0333f2634caff352e8738019a86c09870c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 06:56:59 +00:00
hjk
77d7b24326 Utils: Make Environment::setEnglishOutput a proper member function
The previous indirection was useful as long as they were overloads
for QProcessEnvironment and QStringList, but these are gone now.

Change-Id: I5066bd2e72fd06948a5cc7bbac6dda9006db96ed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-21 15:07:34 +00:00
Eike Ziller
b3a893e9b8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
2021-05-05 11:46:19 +02:00