Commit Graph

361 Commits

Author SHA1 Message Date
Jarek Kobus
2b414508b7 Remove unneeded includes
Change-Id: I67fee9303509b7080e123a2a5826e200ce498ce2
Reviewed-by: hjk <hjk@qt.io>
2020-11-12 12:14:11 +00:00
Christian Kandeler
dd62254e4e QmakeProjectManager: Make "system" execution opt-in
It has too many side effects.
Amends fcd6384f4d.
T_SYSTEM and E_SYSTEM are now treated the same.

Fixes: QTCREATORBUG-24551
Change-Id: Ib6df2762d329f2ddc0dd66190454159d446a9ac9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 10:40:45 +00:00
Eike Ziller
8b031c8c05 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
2020-10-02 10:47:07 +02:00
Christian Kandeler
4c1c11b7b6 QmakeProjectManager: Fix crash on reparsing
After a re-parse, the existing IDocuments need to be updated with the
new QmakePriFile object, as the old one may no longer be valid and thus
cause a crash on the next re-parse.
Amends f3bd07efd1.

Fixes: QTCREATORBUG-24683
Change-Id: Ib03d3005cb7831f1e05cb116aa3cdfe6cf5e72ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-28 11:29:41 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Christian Kandeler
f3bd07efd1 QmakeProjectManager: Restore incremental re-parsing
This was broken in commit 37aecdd112, where we overlooked that a special
type of IDocument was used that triggers a re-parse of only the affected
part of the project tree. As a result, all changes to a .pri or .pro file
would trigger a re-parse of the entire project.

Fixes: QTCREATORBUG-24572
Change-Id: I480cff4e53cf86a17e1eaac0eb9b32901bc87051
Reviewed-by: hjk <hjk@qt.io>
2020-09-15 09:19:23 +00:00
hjk
c3ab20ef9c Qmake: Drop use of QTextCodec in pro parser
This follows 42d2d70ab in qtbase.

Change-Id: I519a20421ce452984fa21ec0f988379bed9368d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-11 07:14:31 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Stenger
6e798401a0 Fix plugin unit tests when using projects
The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.

Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-17 04:13:30 +00:00
Christian Kandeler
1d2af6b4cc clang-tidy: Consider context when encountering duplicate files
Prefer source files from contexts where we know that they actually get
built and thus should have includes and compiler flags properly set up.
Also fix the qmake and qbs project managers to not mislabel any non-
application products as libraries.

Fixes: QTCREATORBUG-23394
Change-Id: I0d122c7b58e12d14d68a1ca7337df83074299cd7
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
2020-06-12 09:14:31 +00:00
hjk
db4f6a0e94 QmakeProjectManager: Suppress parsing for inactive build configurations
Change-Id: I25bf1cd4e1382ecf55df853f4f1ee3c16657a2f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:34:32 +00:00
hjk
f120d78f32 QmakeProject: More and better tracing
Hide the parameters behind yet another macro to get a uniform layout
and avoid parameter evaluation in the normal non-traced case.

Change-Id: Iaf24b0f1b285c8f664f8b3476ae82c39c1a2d7dd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:29:06 +00:00
Eike Ziller
d79febdde9 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakekitinformation.cpp

Change-Id: I90ef0063ed24e23bcb3d73fff086f50324faa1e2
2020-04-24 13:58:05 +02:00
hjk
85597f85b0 QmakeProjectManager: Fix missing run button activation
The problem could be reproduced as follows:
  - open any bigger qmake based project (e.g. QtCreator)
  - de-activate all kits
  - activate one kit
  - wait until the first parse (e.g. Debug build finished)
  - switch to Profile, and toggle the Shadow build button

The toggling re-starts the parsing.  The parse guard will not be released
in decrementPendingEvaluateFutures() (arguably correct as the parsing as
a whole is not done). On enteringing incrementPendingEvaluateFuture()
due to the re-start, the guard still guards the parse, but a new guard
is created in guardParsingRun(). As this happens while the build system
isParsing() is true, the created parse guard will be "non-guarding".
On assigning to m_guard, the original guard object will fire and then
be replaced by the non-guarding guard, that never fires again, so the
the build system will never have hasParsingData(), which is a
condition for the run buttons to activate.

As a workaround for people running into this issue in 4.12.0:
Select 'Run qmake' from the menu (any subproject suffices), and let
it finish.

Change-Id: If7a55db56ec67bac2635fb9a745b9aaf6ca6a413
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-24 09:58:34 +00:00
hjk
f781a72825 QmakeProjectManager: Add more detail do trace message
Change-Id: Ide8917d826baaa7277dde744f3843d5ab7fe0afd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-23 05:01:02 +00:00
Eike Ziller
deb0eaf795 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I34c3d1fd5be90537e37d15e00b1a0d455d1bf81d
2020-04-14 09:47:38 +02:00
Christian Kandeler
c0ea5736f3 Fix invalid reports about Qt <-> project mismatch
For instance, the warning was potentially erroneously triggered with
examples distributed via the installer, as those are present only once
for different installations with the same version number.
Amends e4738904d9.

Fixes: QTCREATORBUG-23753
Change-Id: I0dbb296cd974a3530222661c4b8cecc2106f0ea5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-04-08 08:44:49 +00:00
hjk
2444595fbc Qmake: Move context build action handling to build system
Among others, this removes the wart introduced in 4d3d2d0dfb.

Change-Id: Iafa63f6e4cca327a1d1dd6a8bbcfaa10032327db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-30 10:21:55 +00:00
Tobias Hunger
10e79cebc9 BuildSystem: Add buildConfiguration() method
Add a buildConfiguration method that returns the saved
BuildConfiguration or the active BuildConfiguration if none is
set.

Change-Id: I8af25aa1037f59a0091900bac7eb84fed9e5fbb0
Reviewed-by: hjk <hjk@qt.io>
2020-03-23 13:16:15 +00:00
hjk
80a766a2cb Qmake: Move buildDir() from ProFileNode to QmakeBuildSystem
More a buildsystem than a node thing in general and removes
one use of activeBuildSystem and one use of the ProFileNode
-> ProFile back pointers.

Change-Id: Ie007fcd0db9e9294a08b3a1cd68f825c7d3dc9b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-23 07:42:15 +00:00
Tobias Hunger
a596421ffc BuildSystem: Clean up use of BuildSystem::(kit|target|project)
Change-Id: I4852689cb54d02bb278f9cd596f1de506a43fc04
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:10:01 +00:00
Christian Kandeler
f7d91a01d1 QmakeProjectManager: Use delay timer from base class
Change-Id: I38b55efc34b34b58430d1d665eb6672c3de89b4f
Reviewed-by: hjk <hjk@qt.io>
2020-03-16 13:00:16 +00:00
Eike Ziller
22cdc47077 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp

Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
2020-03-16 08:30:33 +01:00
hjk
3d67fbc55f Qmake: Do not delay initial parsing
And add some logging to make the situation debuggable.

There are a lot of reasons that currently trigger (or attempt to
trigger) parsing, including two unconditional ones on build system
construction and fromMap. Some can be avoided, but keeping track of
which one will be the "needed" one gets tricky without additional state.

So turn it around and try to reparse "immediately" until such a parse
finished. The parser itself is robust enough to deflect repeated
runs before the first one finishes.

Change-Id: Ic992b8730fa3a09ca14532cdd9bdbab4c245cb41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-12 09:01:26 +00:00
Leena Miettinen
8bb3102438 qmake: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: Id567c21af61c939e177c65b2e1907b13f9b0bb62
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-11 12:00:38 +00:00
Eike Ziller
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
hjk
b0b50257ec ProjectExplorer: Pass extra project files as QSet
They are available in some cases as such, and consumed as such.

Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-03 09:17:20 +00:00
hjk
4672013595 QmakeProjectManager: Merge QmakeManager into QmakeProjectManagerPrivate
No need for two manager type classes talking mostly to each other.

Change-Id: I82a52385df08dc4cddac2d294661341a79b86a4d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:26:28 +00:00
Eike Ziller
61dc14b67f Merge remote-tracking branch 'origin/4.12'
Change-Id: I3e7049da2c3da6f784e3cb3407c22ada556e5d24
2020-02-26 08:35:05 +01:00
hjk
cc857390f8 QmakeProject: Use buildsystem's own build config for toolchain tests
It is currently only getting there if it's the active one, so it is
not a real problem, but distracting.

Change-Id: I1f83644a71a3f22e23f966e273c1a23cfc0cc6b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-25 13:38:53 +00:00
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
hjk
e9f2178a4a Qmake: Use direct access to build config from system when available
Change-Id: Ic514fb73db90f0868679d04efba62c40e28b7b59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-07 10:55:34 +00:00
Christian Kandeler
96868447ce QmakeProjectManager: Make sure we reset the ProFileCacheManager
Otherwise, we can get an assertion when exiting during a parse.

Change-Id: I3a2a1fbb854662b77b2e1485a9097b9f39d94fe2
Reviewed-by: hjk <hjk@qt.io>
2020-02-07 09:40:14 +00:00
hjk
278e981422 Qmake: Deactivate parse guard before it can cause trouble
... in the QmakeBuildSystem destructor

Change-Id: I23336cc0b72673fd2c63235b1c568439159d3d8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 16:45:04 +00:00
Tobias Hunger
e4738904d9 TargetSetupPage: Improve reporting on invalid kits
Give the reason for a kit being disabled in the tooltip.

E.g. for a CMake project you will now get

"Kit is invalid: No CMake tool set."

instead of a generic error message about the kit being invalid.

Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 13:50:57 +00:00
Christian Kandeler
37aecdd112 QmakeProjectManager: Do not keep an IDocument in QmakePriFile
Instead, we keep the IDocuments as "extra project files" in the Project
class, like the other project managers do it.
This has two advantages:
    - The document is no longer created in a parser thread
      callback, improving Qt Creator responsiveness while
      loading a project.
    - The IDocuments no longer get needlessly destroyed
      and re-created on a re-parse.
This is relevant because adding these objects to the DocumentManager
results in the creation of file watchers, which is expensive.

Task-number: QTCREATORBUG-18533
Change-Id: I49c03377974e6b33340234dbabbbd82b8d0c827c
Reviewed-by: hjk <hjk@qt.io>
2020-02-04 11:01:01 +00:00
Christian Kandeler
c7d8b9b01c QMakeProjectManager: Move some parsing code out of the UI thread
When parsing larger qmake project, the callbacks from the parser threads
are currently overloading the UI thread, often rendering the application
non-responsive until the project is completely loaded.
This patch moves some expensive operations from the UI thread into the
parser threads, at the cost of a somewhat ugly two-stage setup for some
types of objects.
On my Linux machine, I measured that the time spent in parser callback code
went down by almost 50% when loading the Qt Creator super project.

Task-number: QTCREATORBUG-18533
Change-Id: If9624da5b07e81a50c180693580b20a70e1aaea7
Reviewed-by: hjk <hjk@qt.io>
2020-02-03 16:07:54 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
hjk
5bac811432 Qmake: Move some non-configuration code from build config to build system
Change-Id: I6fdf20e740c2824cabb3659f36379f9325ab97bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-25 14:44:43 +00:00
hjk
c2127c9ec4 ProjectExplorer: Introduce and use a Target::buildSystemUpdated signal
Change-Id: I497d46866146600a1ed9162bd720c574ee4d4769
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 13:08:06 +00:00
hjk
738bbf1a87 ProjectExplorer: Introduce per-buildsystem setRootProjectNode
Currently diverting to the original Project::setRootProjectNode.
Idea is to focus on the BuildSystem <-> generated tree relation.

Change-Id: I8b20173e364713f0919cf4f8b76a2f79ef8770bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:40:22 +00:00
hjk
95ba85c86e ProjectExplorer: Use a Kit to initialize KitInfo
Change-Id: I70a83ff9a9da814b4e1ad9ce5e0b626105c09ca4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-11-20 11:31:14 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Ulf Hermann
3c556096ca qmake: Update the target info before updating code models
At least the QML code model would like to know what application targets
are available, so that it can figure out where to look for app.qmltypes
files.

Change-Id: I638936a90a91193bb59bd9b6827786e25f4eaad3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-28 07:47:49 +00:00
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
hjk
66c7d75dbd Qbs, Qmake, Python, Generic: Introduce BuildSystem derived classes
... and move context menu action handling there.

This is a temporary measure to be able to move that functionality
alongside the actual BuildSystem to the BuildConfiguration.

There is a lot to be cleaned up left, to keep the patch small.

Change-Id: If4b0820a13b376fc97b70785052924972ce22705
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-25 07:55:10 +00:00
Christian Kandeler
7bbfa2de16 QmakeProjectManager: Do not start parsing without a target
This "feature" generated misleading output when opening a project
initially.

Change-Id: I86c541266ffbf576899004f4e6401feea6f38173
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-18 12:20:26 +00:00
Tobias Hunger
d6d05abccc BaseQtVersion: Return FilePath from frameworkInstallPath
Rename the method to frameworkPath to be more in line with the rest.

Change-Id: I3e018ca91e027a95d1ef4993705781957bc68144
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 07:37:41 +00:00