Commit Graph

354 Commits

Author SHA1 Message Date
Christian Kandeler
61932b5d4b QbsProjectManager: Use the same build key as in previous versions
We changed the build key derivation method in commit 6913947986 under
the assumption that it doesn't really matter as long as it's unique.
However, this value gets serialized, so the change broke restoring
existing qbs run configurations.
As we don't want users to lose all their run configs when upgrading to
4.12, we switch back to the old pattern.

Change-Id: Ia4a353af08cca33dbc3c60bd9fc0e28f42dcfe20
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 15:49:12 +00:00
Christian Kandeler
beed0c7396 CMake/Qbs: Do not emit Project::fileListChanged()
...explicitly.
This is already done as part of Project::setRootProjectNode(), and the
signal is connected to some rather expensive operations.

Task-number: QTCREATORBUG-18533
Change-Id: I96ea2f49c866f2b60f599748c4d5b82c790ed2ca
Reviewed-by: hjk <hjk@qt.io>
2020-02-07 09:39:19 +00:00
Christian Kandeler
a6e6a53e82 QbsProjectManager: Build up the project tree in a dedicated thread
... and only switch the root node in the UI thread.
Creating the project tree can take some time for larger projects; no
need to block the UI for that.

Task-number: QTCREATORBUG-18533
Change-Id: I093dc9fb8f3454011a3c64bcc0f785e8b7753b4e
Reviewed-by: hjk <hjk@qt.io>
2020-02-06 17:00:56 +00:00
Christian Kandeler
cd9571b4f7 CppTools: Optionally move raw project parts creation into thread
... by letting callers pass in a generator function.
This takes some load off the UI thread for larger projects.
For now only used by the QbsProjectManager, which can provide a thread-
safe generator function due to the project data existing in "value"
form.

Task-number: QTCREATORBUG-18533
Change-Id: I525dea36a4c4079bd1bd5a4fff844617547d56f1
Reviewed-by: hjk <hjk@qt.io>
2020-02-06 15:53:46 +00:00
Christian Kandeler
faa56b1965 QbsProjectManager: Fix setting up extra compilers
There were a couple of typos breaking the functionality.
Also separate updating extra compilers and the code model.

Change-Id: Ie8f7bbf62d4b7817af3a26298401ad99c011b6e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-06 09:53:17 +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
Christian Kandeler
f0316dbae9 QbsProjectManager: Do not call qbs config unnecessarily
- We know the name of the profile for a given kit. There is no need to
  call qbs config to retrieve it.
- Do not update a profile upon kit removal.

Change-Id: I1a555233091c69d9ea6daa1e4a11737719c37fdf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-06 11:04:43 +00:00
Christian Kandeler
142d4ddb28 QbsProjectManager: Let users provide a default install root
Fixes: QTCREATORBUG-12983
Change-Id: I016d298aaf8abc0d96267115225ab825bdd039e9
Reviewed-by: hjk <hjk@qt.io>
2019-11-22 11:34:19 +00:00
Christian Kandeler
6913947986 QbsProjectManager: Switch to an out-of-process approach
That is, do not link to the qbscore library anymore. Instead, use the
JSON-based API.
Advantages:
    - We can build Qt Creator with qbs support without qbs being present
      on the build machine.
    - Smaller memory footprint for Qt Creator, as the qbs build graphs
      are now being managed by a separate process.
    - Potential crashes in qbs will not kill the Qt Creator process.

Fixes: QTCREATORBUG-20622
Task-number: QTCREATORBUG-22904
Change-Id: If7d344b0ac65a99ff0a3a3db215d61b8d903e47e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-21 13:32:18 +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
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
ab355bb157 QbsProjectManager: Fix document filtering
This was broken in 929083e7b6.

Change-Id: I5341a90bf8067d93485a75827309840b5212d2b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-18 12:06:24 +00:00
Christian Kandeler
f5e25c50db QbsProjectManager: Fix build
BuildStepList: :allOfType() was newly used in 4.10 and removed in 4.11.
Change-Id: I3129f4a8aa411547e018c88eec02df58f56285f9
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 15:59:38 +00:00
Eike Ziller
fcb12a275f Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/projectexplorer/deploymentdata.cpp
	src/plugins/projectexplorer/msvctoolchain.cpp

Change-Id: I64c304fc71435629a6a0060a9df71e8952699508
2019-10-16 15:27:22 +02:00
Christian Kandeler
e0ebda45db QbsPM: Fix look-up of executable on Desktop
... if installation at build time is disabled and a dedicated install
step exists.

Fixes: QTCREATORBUG-23039
Change-Id: I7115368bb1993ebdb48200d2a9c55c34a7bdceec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-10-11 08:56:00 +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
Eike Ziller
8452264a18 CppTools: Move QtVersion and BuildTargetType
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.

BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).

Removes dependency on ProjectPart from RawProjectPart.

Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-10 07:31:21 +00:00
Christian Stenger
6ef98541f7 QbsProjectManager: Fix compile for old gcc
Change-Id: Ic2db2bea982c36a26e54033594d39f7a39c6e6f1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-04 05:05:56 +00:00
Eike Ziller
c7e3bbcd11 CppTools: Remove dependency of RawProjectPart to ProjectFile
The feature to category files to ProjectFiles was used by the qmake
project manager to specify if the file is "active", and by the Qbs
project manager to avoid unnecessary MIME type checking.

Make these two different use-cases explicit in the API.

Change-Id: Ia5a7da37f100149366fc75060fe04687e15f2bd3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-03 13:15:31 +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
Tobias Hunger
988d376ad0 ProjectExplorer: Handle parsingStarted/Finished in BuildConfiguration
Make all buildconfigurations disabled while the project parses.

This unifies how this is handled in different build systems.

Change-Id: I6afca3743ad1433529a4f9d3bfdf73042799e456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-21 08:32:22 +00:00
Tobias Hunger
929083e7b6 Qbs: Simplify based on Project::projectFileIsDirty signal
Change-Id: Idbb55851a3c6ec0c42c75eaa5c0bc89048bd5077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-16 12:44:37 +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
16b9a47e83 ProjectExplorer: Replace Project::projectConfigurationChanged
... by a Project::buildConfigurationChanged. That's the only case
used, and saves filtering on the receiver side. Also, the passed
bc is (in non-null) the active one, so isActive checks are not
necessary.

The null case seems to be only possible to trigger when removing
the currently active build configuration manually i.e. happens rarely,
so having it trigger an unneeded final display update on the dying
build config is tolerable, so drop the null check in such cases
to achieve a more uniform pattern.

Change-Id: I46f72e9e277767214dbd6920dd86b026a7084f46
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 13:59:31 +00:00
hjk
1dfa84c362 Qbs: Work around recent regression in build config connections
... by using direct calls instead of relying on project subscribtions.

Amends  4c80380478.

This is arguably even progress by itself as the direct call is
cheaper than the signalling.

Change-Id: I63400e76826db4517a5a5865e17620c131c69dce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 11:28:27 +00:00
hjk
d3b770c398 Qbs: Three more cases for Utils::to{Set,List}
Change-Id: I6a400b06ad26c8ee92f13c6bd8b6b0c9e317f897
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-29 11:27:31 +00:00
Christian Kandeler
b1dbd7e358 ProjectExplorer: Update run config list centrally
This prodecure requires no further information from the specific project
managers, so we can start it from the ProjectExplorer itself.
Also wait until after project parsing has officially finished and the
run configurations have updated their "enabled" state. Otherwise,
RunConfiguration::isEnabled() will always return false, potentially
leading to the active run configuration getting switched
unintentionally.

Fixes: QTCREATORBUG-21692
Change-Id: I32f4f758b5baa6222329d07b811993568eff1ee3
Reviewed-by: hjk <hjk@qt.io>
2019-07-22 14:02:57 +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
Christian Kandeler
61b4ef6bfa QbsProjectManager: Correctly categorize cpp.systemIncludePaths
... for the code model.

Change-Id: Ibcbd8d42929373a765adb6bf2a9e9f7f730bdb57
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-10 11:01:29 +00:00
hjk
b9d6721be8 ProjectExplorer: Reduce ProjectExplorer::configureAsExampleProject()
... to the bits that are actually used.

Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 10:05:19 +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
Ville Nummela
63e4180242 ProjectExplorer: Add special handling for removing files
... from a project which are pulled in via wildcards.
Such files cannot be removed from a project file, because they are
not listed verbatim. This kind of failure should not be reported to the
user if the file is also deleted, as the file list will have the correct
state after the next reparse.

Fixes: QTCREATORBUG-22586
Done-with: Christian Kandeler <christian.kandeler@qt.io>
Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7
Reviewed-by: hjk <hjk@qt.io>
2019-06-25 11:53:58 +00:00
Christian Kandeler
0c74f6cc21 ProjectExplorer: Add "build for current run config" menu entry
This lets users build the executable corresponding to the currently
active run configuration. It's functionally equivalent to locating the
corresponding node in the project tree and choosing "Build" from the
context menu.

Fixes: QTCREATORBUG-22403
Change-Id: Ic2b729c7ce17f1ad944dc06746bb9d6db90b6c61
Reviewed-by: hjk <hjk@qt.io>
2019-06-06 15:05:56 +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
hjk
f8e21037e3 Qbs: Move environment cache from runconfiguration to project
Change-Id: I2a987e55cde133931bb4578506bb26666eece601
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-24 14:05:21 +00:00
Eike Ziller
829a08047f Merge remote-tracking branch 'origin/4.9'
Conflicts:
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I473084232ab99c18e2316154656de0035af02628
2019-05-17 12:47:24 +02: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
Christian Kandeler
da1bca07a1 QbsProjectManager: Consider cpp.minimum*Version properties
... when setting up the code model for Darwin targets.

Fixes: QTCREATORBUG-22355
Change-Id: I5cade8d3139dc3602298e9d4d056c9745b208489
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-05-09 11:57:51 +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
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
Christian Kandeler
7e3356c324 QbsProjectManager: Fix infinite loop when "force probes" is checked
This happened for all projects with a Qt dependency, because the module
provider kept recreating the Qt modules, which in turn caused Qt Creator
to re-parse the project.

Change-Id: I77c5c8723c1d0bcd477db648692ddaf9e060ce99
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-04 08:32:49 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
hjk
070e0efdcc ProjectExplorer: Rename IBuildConfigurationFactory
... to BuildConfigurationFactory. It hasn't been an Interface for a
while and the new name matches Run- and DeployConfigurationFactory

Change-Id: I923c6a27e18a99628251b69e0270e910836e7b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-29 11:38:31 +00:00
hjk
e6a184fe5c ProjectExplorer: Merge Qbs* into DefaultDeployConfigurationFactory
DefaultDeployConfigurationFactory used extra effort to not apply to the
Qbs (Desktop) case, with QbsDeployConfigurationFactory plugging exactly
that hole with essentially the same functionality, which is even the
default of the base class.

The only differences are the display name, which is dropped in this
patch, and the different keys in the .user file, which are updated
with this patch. Note that the display name "Qbs Install" for the
DeployConfiguration stays with this patch whereas a freshly created
one will get the default "Deploy Configuration" name.

Change-Id: I255371d0a0688fbc6303083eb6aa20563e876264
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-25 09:57:08 +00:00