Commit Graph

38 Commits

Author SHA1 Message Date
Jarek Kobus
ff6e231170 CompilationDatabaseBuildSystem: Remove unused QFutureWatcher
Change-Id: I6dd6769cb5aa71149735a7920701c8f6ad98ee03
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-26 09:33:43 +00:00
hjk
8976d78b8d CompilationDatabasePM: Use setup function for plugin items
Change-Id: Idd1a6dc1af49fc1e713524677b80ed2010b8f17d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-02-01 08:22:55 +00:00
hjk
b89baec2c1 ProjectExplorer: Promote CppProjectUpdaterInterface
... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.

Also add the self-registering factory boilerplate and adapt all
buildsystems.

Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-06 14:50:10 +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
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
Christian Kandeler
939cc5af21 ProjectExplorer: Give build systems a name
... and make it accessible through a variable.

Fixes: QTCREATORBUG-26147
Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 14:41:56 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +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
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
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
3c41b91d44 ProjectExplorer: Settle on fixed set of build step lists
Even if the implementation allowed different lists than 'build'
and 'clean', that's the only set that has been used, ever.

If really needed, this could be re-instated, but for now having
them fixed removes part of the neeed for a two-phase construction
and helps to simplify user code.

Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-06 14:49:59 +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
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
ae345003aa ProjectExplorer: De-virtualize some more virtual methods
Use setters/getters for the bool flags in
Project::needsBuildConfigurations() and
Project::hasMakeInstallEquivalent.

Change-Id: I5ce937c3a5e8e0db627cda02a9007f8c28ccda0c
Reviewed-by: hjk <hjk@qt.io>
2019-08-13 10:24:30 +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
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
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
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
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
Ivan Donchevskii
b991e0ca95 CompilationDatabase: Fix few bugs and plugin tests
- do not convert the DOS path if it does not exist
 - pass the proper flags to addDriverModeFlagIfNeeded
 - reset the kit toolchain before picking the matching one
 - do not show the popup when running plugin tests
 - clang++ contains 'g++' but it's not a gcc compiler

Change-Id: Ia5018a2131bb123202b87e34e0ac3a79f0feb45d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-26 08:34:11 +00:00
Christian Kandeler
261d7752b0 RemoteLinux: Retrieve deployment info from local install root
This provides correct deployment information as seen by the build system
when Qt Creator cannot retrieve it directly.
It's most useful for autotools and cmake projects, but can also help
with qmake in certain edge cases.

[ChangeLog] It is no longer necessary to provide a
QtCreatorDeployment.txt file when using CMake projects with remote Linux
devices.

Fixes: QTCREATORBUG-21855
Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-23 15:52:05 +00:00
Ivan Donchevskii
2c5808bada CompilationDatabase: Ask for the root path and scan for headers
Let's use the same approach we have for CMake projects by using
the same TreeScanner class.

Compilation database does not have a concept of the root directory
so let's show a file dialog and ask for it the first time the project
is loaded. Next times we open it we take this path from settings.
This root path can later be changed from the project tree context menu.

Fixes: QTCREATORBUG-22031
Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-05 15:26:19 +00:00
Ivan Donchevskii
ed43e6d99f CompilationDatabase: Refresh the tree on the JSON file update
Reparse the compile_commands.json file when it has changed.

Fixes: QTCREATORBUG-21733
Change-Id: I8e5a99efd136b1d46a417817bde5b5b989109eea
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-03-15 08:15:47 +00:00
Ivan Donchevskii
f604c8a77c CompilationDatabase: Support both code models
Extract headers, defines and fileKind from flags in
order to have complete project parts.

Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 14:52:05 +00:00
Ivan Donchevskii
c99fb5d0bc Plugins: Add compilation database plugin
Introduce compilation database project support.

Pass the arguments list for each file directly to
ClangCodeModel via extraCodeModelFlags therefore
introduce a dependency from the ClangCodeModel plugin.

Change-Id: Iea5760d379de1ea246382dce56de0adf7ab5673d
Task-number: QTCREATORBUG-21115
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-19 12:11:36 +00:00