Commit Graph

96 Commits

Author SHA1 Message Date
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +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
hjk
9679412a23 Replace QFile::exists by QFileInfo::exists
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.

Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-01 10:24:31 +00:00
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
d8de6c88e9 Avoid creation of temporary lists of ProjectNodes
Change-Id: Iac84f7f95291fb3b12a071a066d358aaab309c52
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-17 11:05:39 +00:00
hjk
2704f8ff0b ProjectExplorer: Proliferate FilePath a bit
Change-Id: Ia671a1de17b9e58764375c5f64cc47b053b0725a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-15 09:57:02 +00:00
Alessandro Portale
e27f82b49e Translations: Merge "OpenWith::Editors" into "QtC::Core"
Change-Id: I241ccc53afa11fa3faa1f1ca9363421827081812
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-20 08:00:37 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Alessandro Portale
4f55dbdd38 CompilationDatabaseProjectManager: Tr::tr()
Change-Id: I5a4b05ce3eab90cfe05c297fa3971f94270ec474
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 15:03:32 +00:00
hjk
8a8b50e8b5 ProjectExplorer: Proliferate Utils::FilePath use
Move the .toString() uses into  DeploymentData::addFilesFromDeploymentFile

Change-Id: Ic9ef22da1918ca105c92f0231960dab27b0d80bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 08:21:29 +00:00
David Schulz
739d4942e2 Merge remote-tracking branch 'origin/master' into 10.0
Change-Id: I9f6090e2a9f62fd3a9823f5a7342ea423dfbb2ac
2023-02-01 05:24:33 +00:00
Christian Stenger
04f521abcf CompilationDBPM: Adapt to FilePath change
Change-Id: Idc2987e0568d34cf024cb170aa604f47053c9617
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-30 12:20:20 +00:00
Jarek Kobus
62e0b4052f Remove unneeded includes of utils/runextensions.h
BTW, spotted some other unused includes marked with yellow.

Change-Id: I364e4b6fae73a2be2cfd3a63c1100be4a91aa49a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-27 13:16:44 +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
9f7cdd6d3c CompilationDbProjectManager: Fix tree scanning
- We checked for the QFuture's canceled status at a time where it would
  always yield true.
- A pointless default value was used for the project root path.

Fixes: QTCREATORBUG-26356
Change-Id: I4d17c6ecb7e9e7e71df737d85b42feb37d3ead5d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-22 09:06:09 +00:00
Orgad Shaneh
f2f1fc8601 Use lowercase for Windows header for supporting cross-compilation
Linux mingw uses lowercase headers, so cross-building on Linux for Windows
target must use the correct form. Windows is case-insensitive, so it won't
affect host-native builds.

Change-Id: Ic2140412bb367bbce83b5e2546d70e0936928c5c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-27 07:23:22 +00:00
Eike Ziller
877bfa4056 Add FileSystemWatcher::clear()
Change-Id: I9f28e763c943a6d8c5cf3082755e64d7e4df7155
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-15 06:40:38 +00:00
Eike Ziller
8e51295959 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/libs/utils/processreaper.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
2021-09-07 11:05:40 +02: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
Cristian Adam
830aeb8010 CompilationDatabasePM: Fix crash at loading project
If rootPath is empty, QtCreator will crash.

Fixes: QTCREATORBUG-26126
Change-Id: Iac0d29d84d7203c0ec2ac8f5e3035816f52d7cdc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-01 13:33:03 +00:00
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