Commit Graph

3443 Commits

Author SHA1 Message Date
hjk
ce1e565a10 Utils: Also rename parameteraction.{h,cpp} to action.{h,cpp}
Change-Id: I203909d9b2d460012b9347d507ac7a701700c48a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-29 14:23:39 +00:00
hjk
ec983a6462 CMake: Some code cosmetics in cmakeeditor.cpp
Mostly namespaces and 'final'.

Change-Id: Ifda9fe2af0b83b4ebb71c936a5ab6352d650ccec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-01-29 13:42:40 +00:00
hjk
5646aae859 CMake: Use setup functions for a few more cmake related items
Change-Id: I7a1bbea9507d7d168584348a51d557f4a910de47
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-01-29 13:42:27 +00:00
hjk
cc64c84b5f CMakeProjectManager: Use setup function for CMakeToolManager
Change-Id: I66078250029f87d64b7b31aba9049a8b0b68f3a5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-29 13:28:33 +00:00
hjk
66b50438d8 Utils: Rename ParameterAction into Action
It became the defacto-type for action when ActionBuilder started
creating them as default.

Change-Id: I1008d60b78ea83919ce1c80a7ef828527fe9902c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-29 13:01:29 +00:00
Cristian Adam
76a8966739 CMakePM: Refactor CMakeLists|Cache.txt as constants
Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-29 11:50:21 +00:00
Jarek Kobus
11a8c55f38 Various plugins: Remove unused variables
Change-Id: Ie2e5eb38d81a7582c5715654f09f28deb4ab11c5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-29 07:44:39 +00:00
hjk
109ec1e443 CMake: Hide CMakeManager implementation in .cpp
Change-Id: Ia66d73cd060d17c2d25a1d5b89155ab4e7a6b62b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-26 12:31:05 +00:00
Marcus Tillmanns
a25bbf23c6 Utils: Fix error prone default value of appendOrSet
It was not readily clear that Environment::appendOrSet/prependOrSet
needed a value for "sep", otherwise it would just concat the values without separator. This got apparent when looking at usages of
appendOrSet.

Instead there are now three options, "Auto", "Colon" or "Semicolon"
with the default being "Auto", which determines the separator based on
the Environment::OsType.

Usages of appendOrSet and prependOrSet are also fixed with this commit.

Change-Id: I868e14ce38f50be9cd07292fe3f22663a62d116d
Reviewed-by: hjk <hjk@qt.io>
2024-01-26 10:10:03 +00:00
Cristian Adam
a8370aaf81 CMakePM: Allow adding files to OBJECT libraries
Amends 7a46bbe667 which only used
`cmakeTarget->productType() != ProductType::Other` which excludes OBJECT
libraries.

Now the fix actually includes all targets which are not UtilityType,
which was the intention of 7a46bbe667

Fixes: QTCREATORBUG-29914
Change-Id: If661828e43d5c566c876546f5527c0b670405e47
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-25 16:41:31 +00:00
Cristian Adam
0197a2780a CMakePM: Do not force Xcode generator for iOS
"Xcode" will be set as default generator for iOS kits, but if the user
imports a iOS build from command line we shouldn't reset that generator
to "Xcode".

Amends b47a80c5ce

Fixes: QTCREATORBUG-30214
Change-Id: Idbdadcf24e87b861adf377975788e0146f7731cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-25 10:15:55 +00:00
Cristian Adam
c05ad8b446 CMakePM: Fix bad "path" backtrace generation
CMake can generate backgraces with absolute paths, and the commit
246f33c20d removed this support from Qt
Creator.

This commit fixes this issue with absolute paths.

Fixes: QTCREATORBUG-29914
Change-Id: Ib911e80aee1ff9f4a26435f7e693f7766551cc90
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-24 15:02:49 +00:00
Jarek Kobus
afc67468e6 Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.

Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:51 +00:00
Jarek Kobus
f6be85b1d2 Process: Refactor timeout handling
Rename ProcessResult::Hang into Canceled.

Change the behavior of the Process:
Whenever the terminate() or kill() is called, including
indirect calls through stop() or runBlocking()'s timeout,
mark the process result as Canceled.
In this way the Process running by a call to start()
may also finish with Canceled state. Before it was only
happening for processes started via runBlocking().

Adapt the runBlockingStdOut_data() test accordingly.

Get rid of ProcessInterface::m_canceledByUser field.
Use ProcessResult::Canceled state instead.

Fix existing 3 usages of m_canceledByUser field.
Use standarized exitMessage() method for them.

Add automatic measurement of process execution.
Introduce processDuration() getter.
Use it for reporting exitMessage() instead of timeoutS().

Change-Id: I1a68559ce844caef863a97a6b0577b0238011f70
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:38 +00:00
Jarek Kobus
290121bc21 Process: Use more rawStd{Out,Err} const methods instead of mutable ones
Avoid using readAllStandard{Output,Error} mutable methods if possible.
Use non-mutable methods when we are not connected to
readyReadStandard{Output,Error} signals.

Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 17:21:25 +00:00
Jarek Kobus
04b80f092a ProcessProgress: Add setExpectedDuration() method
This is not the same as process timeout, so make these two
settings orthogonal.

Change-Id: I3fc774c183282fe770feb49258d77d0ce3637b38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 10:13:46 +00:00
Jarek Kobus
9aa37ee9d9 CMake: Omit a call to setTimeOutMessageBoxEnabled(false)
The false is a default value.

Change-Id: I94eb7c58ed591171de677f1dfc0d80a0c751d36d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-20 19:04:48 +00:00
hjk
d234e71643 All: More ToolChain->Toolchain renamings
And removal of one unused function declaration.

Change-Id: I594e23401d8f247d3be081ce850005574951899d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-19 10:29:33 +00:00
Eike Ziller
4936a89f16 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I7a2cfa35b5bc9070c66561bfba3e4b5a8e26917f
2024-01-19 09:33:04 +01:00
Cristian Adam
5e6f1f5dac CMakePM: Fix adding qml files to targets using ${PROJECT_NAME}
Instead of looking after the target name reported by CMake's file api
e.g. mytarget, take the parameter name from the function that created
the target.

This way if the user used ${PROJECT_NAME} to mark the name of the target
for qt_add_executable and qt_add_qml_module, when adding a qml file the
proper function would be picked.

Fixes: QTCREATORBUG-30218
Change-Id: I920f16d9f5a6b8a7a2fddb3ef7e97e0e3bccd464
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-18 16:13:50 +00:00
hjk
446d79ad67 CMake: Split big plugin tests into smaller pieces
... which can then live closer to the tested code.

Change-Id: Icd975a76424ea2258c1bb93afdbaabdf1959340a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-15 17:04:37 +00:00
Eike Ziller
3e40f227f5 Merge remote-tracking branch 'origin/12.0'
Change-Id: I70bcac4195095a7646dcdc31532d8f61b643d869
2024-01-10 16:06:29 +01:00
Cristian Adam
7a46bbe667 CMakePM: Do not add files to utility targets
On multi-config systems CMake is reporting "ALL_BUILD" or "ZERO_CHECK"
as targets to add files to.

When issued from menu File > Add New ... the selected target is the
first target namely "ALL_BUILD", which is a utility target and cannot
have source files.

Fixes: QTCREATORBUG-30170
Change-Id: I7617978c01f0a2554a3ec7d52ef9baaa16ed7a84
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-09 18:21:26 +00:00
Dominik Holland
e33d6fe5dc CMake: Expose information about Appman packages as Project extraData
Change-Id: I54c449f5bc7211271cecbef05045dd1490066bd6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-01-08 15:38:12 +00:00
hjk
e65dc8007b CMake: Remove ActionBuilder::setCommandDescription() calls
... where the default implementation via stripAccellerator(action()->text())
would yield the same result.

Change-Id: Ie921863d472e0592a8c97830d67873ccfb1b57da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-08 15:18:18 +00:00
Marcus Tillmanns
690d6a6c8f CMake: Fall back to reading CMakeCache.txt
Allows the user to select cache settings even if configuring failed.

Change-Id: I821c28f386e0c249b4c4d9c6561a377cb48b3f2d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-08 08:24:33 +00:00
Jarek Kobus
afd979a6d9 CMakeManager: Simplify mutable lambda
Make lambda non-mutable. Pass CMakeManager as a context object
into the connection.

Amends ed1568309b

Change-Id: I022a8c468374eaf694acd7d8dbab0579c37bd8df
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-01-03 11:17:03 +00:00
Dominik Holland
ca3fab3a93 CMake: Add information about all sourceFiles to the CMakeBuildTarget
Change-Id: I13b978b2cd344c499c405ce11213261bf224296a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-22 10:25:01 +00:00
hjk
cf4f221065 CMakeProjectManager: Move CMakeIndenter class definition to .cpp
Leaner internal interface.

Change-Id: I297c74e667891efbeab0edabbfc82fb058501aa2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-21 14:59:10 +00:00
Eike Ziller
7443ca977b Merge remote-tracking branch 'origin/12.0'
Change-Id: Iee11f97dbd0114957e856d02f0ad295813a05431
2023-12-20 16:05:55 +01:00
Dominik Holland
eccc244537 ProjectExplorer: Allow an extraInit function to be called
... when BuildSteps are created. Potentially useful to tweak
step behavior without the need to inherit or such.

Change-Id: I8c8e9bdec84fafc454db9dc9a492d399b00b7f57
Reviewed-by: hjk <hjk@qt.io>
2023-12-20 09:59:40 +00:00
Cristian Adam
13efeb4c23 CMakePM: Fix "cm" and "cmo" locator filters
For "cm" (CMake Build) display all targets, including utility targets
like "all", "clean", or "<target>_lupdate" and "<target>_lrelease".

For "cmo" (CMake Open) display only the "real" targets, targets that are
not utility targets and have a backtrace from CMake File-API.

Fixes: QTCREATORBUG-29946
Change-Id: Ica53f4d38bd0c301b6dbfe0754e53c52d1b8d378
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-20 08:16:04 +00:00
Cristian Adam
1ce56fe0b4 CMakePM: Fix library search path for special targets names (test)
Fixes: QTCREATORBUG-30050
Change-Id: I1f0ad5db048976f347a363f3ed12e7881453930b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-20 08:14:59 +00:00
hjk
4347d436bf Core: Return *this from ActionBuilder settings
Useful to chain operations and avoid the repetitive local variable
name.

Change-Id: I4327dbb90d97cbeed370b311c3ade7925ddada0b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-12-19 14:43:25 +00:00
Alessandro Portale
fc3291afed Utils: Proliferate use of <utils/mimeconstants.h>
This deduplicates several mime type strings.

Change-Id: Ib1746387e233ca5b7134e65859b5ec1c7832b8e4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-19 09:38:10 +00:00
Orgad Shaneh
b1413e35f0 CMake: Fix implicit size_t -> int warnings
Change-Id: I6261faad372050fba118f5f5d8db91207d94f941
Reviewed-by: hjk <hjk@qt.io>
2023-12-15 10:44:30 +00:00
hjk
9f342fb396 CMakeProjectManager: Use ActionBuilder for build file action
Previously, ActionBuilder could not handle ParameterActions.
Now it can.

Change-Id: Icfe203c63d5f84198ff88864699acba55516cb25
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-15 10:00:26 +00:00
The Qt Project
96f5e56125 Merge "Merge remote-tracking branch 'origin/qds/dev'" 2023-12-15 09:53:53 +00:00
Eike Ziller
2ce9f9d97d Move most acknowledgments to qt_attributions.json
Create a qt_attributions.json and generate a documentation file from it
automatically when building documentation. The result is included as a
table in the acknowledgments page in the documentation.

Some attributions cannot (yet) move to qt_attributions.json, because
that requires the sources to be available in the project's source tree,
which is not the case for LLVM, Clazy, etc.

Remove the attributions from the README and instead point to the
documentation from there, so we get rid of that duplication.

Change-Id: I22623fe7495593ffce2e2c6c26255c27c5a8cb71
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-12-15 09:02:23 +00:00
Tim Jenssen
06bfa66ed7 Merge remote-tracking branch 'origin/qds/dev'
Change-Id: I6c657f5b8c0602ca76e9b17b10f1ff7a38b1b8be
2023-12-14 19:50:03 +01:00
Eike Ziller
64f0e10a4e Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
	src/plugins/remotelinux/killappstep.cpp

Change-Id: Ife961ca4eb14271c48bd0dbc08e0a0a816935682
2023-12-14 18:03:59 +01:00
hjk
d2ca6afb8f ProjectExplorer: Some more Toolchain renamings
Change-Id: If8bdfd5e49a031a511bc0e062727495a12d2d3bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-14 14:22:47 +00:00
Tim Jenssen
d186d9df6a Merge remote-tracking branch 'origin/12.0' into qds/dev
Change-Id: I0a598ba1b4d57be361a7a203d0c39e99b5cd5fba
2023-12-13 14:53:17 +00:00
hjk
b442ca3873 Core: Rename ActionBuilder::setOn* to addOn*
There could be multiple connections.

Change-Id: I7dbca9d24599f776b7d1f1bfa11826e3eeb5640a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-13 13:00:00 +00:00
Cristian Adam
32c389a556 CMakePM: Do not reconfigure during build
On Windows upon a CMake file change and save during a build, the
reconfiguration would fail due to the inability to save the build.ninja
file.

Fixes: QTCREATORBUG-30048
Change-Id: I68bec70b0a95bc4256b736a1c4caf1b4d706e43b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-13 09:19:26 +00:00
hjk
e17f0b6164 Core: Rename ActionBuilder::setContainer to addToContainer
An action/command can be used in several places.

Change-Id: Ifa26f64f7d200d93ada13f272de0fa833f886997
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-13 08:37:10 +00:00
Eike Ziller
10e5a27c27 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp

Change-Id: If96d0f0a3d48c2581e765e4afb8b23924c48bdd6
2023-12-12 10:17:39 +01:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
Eike Ziller
d3c805630a CMake Debugging: Do not build/deploy
Fixes: QTCREATORBUG-30045
Change-Id: I478abaf29462d9413f3285527459a98b1cae899d
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-11 14:50:17 +00:00
Cristian Adam
6846579266 CMakePM: Allow usage of custom output parsers for CMake output
Fixes: QTCREATORBUG-29992
Change-Id: Ia84871cc963263c34054d17742556b38a1f1934e
Reviewed-by: hjk <hjk@qt.io>
2023-12-11 10:58:21 +00:00