Commit Graph

75 Commits

Author SHA1 Message Date
Nikolai Kosjar
888ea6bbbb CppTools: Take "-include" files into account
Fixes: QTCREATORBUG-20602
Change-Id: Ibfc518fc64ed75f93265db800558ec1d2e424bb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-05 08:49:24 +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
Eike Ziller
227904d4a6 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ic39945a0e3e140a9467b4b4f572929257ff3a324
2020-05-26 09:00:05 +02:00
Christian Kandeler
90499d5a53 CompilationDbPM: Do not change the kit's toolchain
Amends 45d42d4518.

Fixes: QTCREATORBUG-24047
Change-Id: I115eaf06fb3c055069918d20f360bd027f15d680
Reviewed-by: hjk <hjk@qt.io>
2020-05-20 10:18:17 +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
1b9804693d CompilationDb: Make use of BuildSystem base class parsing infrastructure
Change-Id: I928e173b35b87c0fcb8fc97785ddfa4a2414740d
Reviewed-by: hjk <hjk@qt.io>
2020-03-12 11:57:55 +00:00
Christian Kandeler
103ab51f70 CompilationDatabaseProjectManager: Fix autotest
Amends 45d42d4518.

Change-Id: I7404bbc782278d09b419906a0d74f29d66c3867b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-04 13:59:37 +00:00
Christian Kandeler
45d42d4518 CompilationDbManager: Do not create an extra target
The hidden extra target creates all kinds of inconsistencies, e.g.
between mini project target selector and target model.
Besides, there is no reason why this project manager should behave
differently from the others in this respect.

Fixes: QTCREATORBUG-23518
Change-Id: I11022f63bed33191f6349681356b4dd9537de50c
Reviewed-by: hjk <hjk@qt.io>
2020-03-03 14:46:59 +00:00
hjk
afd8bc2c9e De-Q_OBJECT-ify various IEditorFactory derived classes
Change-Id: I1470b06d4e10073bb6e4f7ae735f9829fab3bb7b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-13 12:38:35 +00:00
hjk
b4ee6eb3c0 ProjectExplorer: Move some of the BuildInfo setup code to central places
Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 13:56:10 +00:00
hjk
1eaf44a270 ProjectExplorer: De-QObject-ify BuildConfigurationFactories
The QObject was not heavily used. Object name was for debugging only,
translation context can be taken from the corresponding BuildConfiguration
objects, the qobject_casts in the three big importers are replaced by
dynamic_cast, which is good enough in that context.

Take the opportunity to re-use translations from base BuildConfiguration
for the common cases and sprinkle in some 'final'.

Change-Id: I8e9727c98c6e943cb333556861c24e701c2bdf45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-10 12:46:38 +00:00
hjk
a971da3bfe ProjectExplorer: Replace BuildConfigurationFactory::availableBuilds
... by a function object.

Change-Id: I9953ba6915c0177e7c4067d36dd755fc2ba5cf84
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-09 15:42:21 +00:00
hjk
c832f61e36 Revert "CompilationDatabase: Simplify rootPathFromSettings function call"
This reverts commit ad729a4085.

This breaks non-test builds. namedSettings() is a non-static in Project.

Change-Id: I1675cddfd515a021482769d38092138dbaa055ee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-07 15:27:28 +00:00
hjk
ad729a4085 CompilationDatabase: Simplify rootPathFromSettings function call
Change-Id: I073f6d0f9ad4100f1c93344624efd34a9fb4c225
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-07 12:12:11 +00:00
hjk
668f1b667a CompilationDatabase: Remove unnneded ::fromMap() reimplementaion
Change-Id: I2e9440f146b8ba485d3080e74927a05ae7d68824
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-11 07:04:14 +00:00
hjk
041a86c8c7 ProjectExplorer: Use function object for special build config init
Change-Id: I5da0f28ee1a64f8d9a3145f059019be702bee463
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-09 14:12:45 +00:00
hjk
fd8afd564f CompilationDatabase: Avoid an unneeded cast
Change-Id: I8f6d0d83b25738c164e6e29c317840058fdd8bfe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-21 15:00:59 +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
Christian Kandeler
46d3962d54 CompilationDbProjectManager: Set deployment data, if available
We use the same approach as for the generic project manager, namely the
QtCreatorDeployment.txt file.

Fixes: QTCREATORBUG-22965
Change-Id: Ia49dcd354b9ade8aeda259696aa29692cce1577b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-29 12:50:36 +00:00
Christian Kandeler
61bb28cdc0 CompilationDB: Reparse only on actual project file change
Fixes: QTCREATORBUG-22574
Change-Id: I39fe58f96c1ff9118405be225f39e5348304222e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-22 13:00:42 +00:00
Eike Ziller
ed9177f74c CppTools: Move ProjectUpdateInfo to ProjectExplorer
Used for updating project parts, so move it near RawProjectPart.

Change-Id: I77aeffbdbfb3d2ec0de600f61dcf7fbb7a355a98
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 06:37:41 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Tobias Hunger
3eea938a04 Project: Rename Project::activeBuildEnvironment to Project::activeParseEnvironment
This is used for parsing the project only, so reflect that in the name. Not all
projects have build configurations, so the old name did not make too much sense
for what this has been used for.

Eventually this code should move into the BuildSystem.

Change-Id: Iff766150b5fe370f2912b0b3b15348b1c1fad5b5
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:18 +00:00
Christian Kandeler
69b4e2a118 CompilationDb: Properly set up build info
Avoids e.g. soft asserts in TargetSetupWidget.

Change-Id: I9640ada5d2d015c25c04ddfa2a2443b7444788db
Reviewed-by: hjk <hjk@qt.io>
2019-08-27 10:21:52 +00:00
hjk
fb631cb258 ProjectExplorer: Set up hack to funnel information to buildstep ctors
For now, store most of BuildInfo in the BuildConfiguration. This will
allow accessing it in the BuildStep ctors so the BuildSteps can
be fully setup without polishing afterwards (as currently done
in the main build steps of the three buildsystems, and Nim)

This in meant to be temporary to a large degree.

Change-Id: If6ade6052f4b96670995399ae97ef7d2313f632a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-22 11:05:04 +00:00
Tobias Hunger
abebbdc9f7 CompilationDatabase: Simplify based on Project::projectFileIsDirty signal
Change-Id: Icfcbae73f611d967a7cc2db7c249f6f7190f5926
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:26:30 +00:00
Tobias Hunger
09530d6dcc ProjectExplorer: Use RAII pattern for parsing start/stop signalling
Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-09 12:45:29 +00:00
hjk
09e5c167bd ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit
Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:29 +00:00
hjk
79f9449f68 CompilationDataBasePM: Do not delay creating targets
A target can/should handle/use unparsed projects just fine.

Change-Id: I54b8399eab4b4fe7ead2de3cef8ab25cc7bbc621
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 15:22:59 +00:00
Christian Stenger
39aa325245 Fix compile after FileName drop
Amends 44acfc0702.

Change-Id: I1bddb0642e181b0a02d4ecba7ff1ae282218338f
Reviewed-by: hjk <hjk@qt.io>
2019-07-24 09:47:26 +00:00
Christian Kandeler
f7520b7d99 Make the project managers tell the code model about include paths
... from the environment.

Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-12 09:13:42 +00:00
hjk
5dbfd46bcf ProjectExplorer: Merge BuildConfigurationFactory::availableBuilds
... and availableSetups as far as mechanically possible.

Change-Id: Ia1d7babe943eea25da97cef7838187c234378673
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-27 14:19:53 +00:00
hjk
f94e55b807 ProjectExplorer: Align signatures of BuildConfiguration
... availableBuilds() and availableSetups().

Goal is to merge them and inline all the local createBuildInfo()
functions.

Change-Id: I9f19093163808b6da6dc83977894420e08a1edd9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-27 13:59:39 +00:00
hjk
e7c6169d70 ProjectExplorer etc: More FilePath usage
Mostly for project files.

Change-Id: Icb6059f80758865e42cc9f9c092ec6782770dfd7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-26 16:02:23 +00:00
hjk
f878486fcb Use build step ids for construction in more cases
Change-Id: If2deb7c02c082e29cc6b1f0408c0d0e06d1c584b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-26 15:00:30 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Christian Kandeler
39ffd00744 CompilationDbProjectmanager: Fix build for older compilers
Change-Id: Ie84e5d06b672a335c68528fb1acf4b7492d998cd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-23 12:45:22 +00:00
Christian Kandeler
0ffbe6a9e4 CompilationDbProjectManager: Sanitize project parsing
The parsing code used to access all kinds of stuff (e.g. the project
tree and the toolchain manager) from the non-UI thread, which is not
allowed.

Fixes: QTCREATORBUG-22420
Change-Id: I4be47919d7e543376d31826dd380f66f4e060458
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-05-23 08:56:16 +00:00
hjk
36daca80f3 Utils: Make FileName::canonicalPath a member
Change-Id: I8d7450dec5c4c14ae3e007d1d66f1a9c3c98f807
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 11:06:12 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
hjk
1e9636ab8a Some more FileName::appendPath() -> pathAppended() changes
Change-Id: Ie494f7ae8a96d97c9497b3ef38d774d2cf787b7f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 07:46:56 +00:00
hjk
ce449e4219 ProjectExplorer: Remove BuildTargetInfoList wrapper class
Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-14 13:30:34 +00:00
Thomas Otto
b32c1453b4 CompilationDatabase: enable the listing of non-cpp files
Files listed in an optional "compile_database.json.files" are also
visible in the project, similar to the GenericProjectManager.

Change-Id: I1250b674298079bab90a0ffe036107a09b4ac6e5
Reviewed-by: Thomas Otto <totto@zbh.uni-hamburg.de>
Reviewed-by: hjk <hjk@qt.io>
2019-05-02 14:09:00 +00:00
Ivan Donchevskii
cc9d246b02 CompilationDatabase: Asjust the sysroot and target handling
If the sysroot option is found - set it as a kit sysroot (only
in CompilationDatabase project where we have a cloned kit
which does not affect the other existing kits).
In other cases use the backup for the sysroot from the
toolchain (can exist for clang toolchains based on mingw).

Provide target when searching builtin include paths for clang.

Fixes: QTCREATORBUG-22339
Change-Id: Ibe07c2e490ba4f7e0d259e6df698d641dbfd0298
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 18:00:17 +00:00
Ivan Donchevskii
a5c73fef3d CompilationDatabase: Allow the second root node
The 'directory' field of a compilation database can be
in many cases another root directory to look into.

Change-Id: Ie0d11bdc706f09e4d466b20fef614dd6ce00d4e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-29 14:17:47 +00:00
Ivan Donchevskii
7167656a8d CompilationDatabase: Allow to set custom build step and run command
In addition export the ProcessStep class from ProjectExplorer
not to duplicate the code.

Task-number: QTCREATORBUG-21727
Change-Id: I43d0c83b0338995fdb37ace940092c83ce2b6820
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-29 11:21:57 +00:00