Commit Graph

145 Commits

Author SHA1 Message Date
Christian Kandeler
fb56c82abf QbsProjectManager: Fix one more build key inconsistency
Amends 26e4a2a758.

Fixes: QTCREATORBUG-23841
Change-Id: Ie297f8e2b6a79f6bafa709bf3a0285c9ce6e03ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-09 14:48:58 +00:00
Christian Kandeler
4933f79111 ProjectExplorer: Provide the option to build only the app to be run
... instead of the entire project.
This can speed up the development cycle by ignoring irrelevant changes
in the project, potentially at the cost of missing parts that actually
should be re-built (in particular with build systems where a product
does not have full knowledge of its dependencies).
Supported by qmake and qbs for now.

Change-Id: Ic7101aa243e92ba139798d13366d256c1919dcc3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-12-05 14:18:06 +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
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
Eike Ziller
ac014e3875 Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: I10a749cca38c2d0929cf4d2b74ab089e14b6157b
2019-10-02 07:32:57 +02:00
Christian Kandeler
736eef24ca Designer: Fix look-up of resources for UI files
Commit 81a643ec99, fixing QTCREATORBUG-22412, was too restrictive: UI
files in applications have access to resources of library dependencies,
so we must consider those. We now only exclude resources from other
applications.
Note that this will potentially list non-applicable resources, e.g.
those from libraries to which our product does not have access. This
cannot be reasonably prevented, because not all build systems provide
this information. It's also not as bad as missing resources.

Fixes: QTCREATORBUG-22909
Fixes: QTCREATORBUG-22962
Change-Id: I51a87402b43c156618982813c408060f300e4e58
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 09:27:10 +00:00
hjk
07a918c89a Unification of desktop run configurations, step 1
First step, move {DesktopQt,Qbs,CMake}RunConfiguration{,Factory}
into the same new files.

This only moves down to QtSupport, not ProjectExplorer, as there
are in all three cases direct dependencies on QtSupport. Long term
I would expect them to move further down.

Change-Id: Ib16b19df7f3f642ed7f7db89a1f6904601d976ba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-07 10:35:41 +00:00
Christian Kandeler
46ef3f3027 "New class" wizard: Respect the project's "no Qt keywords" setting
Fixes: QTCREATORBUG-6812
Change-Id: I3f51c61f7a1ed1e4626be6bc31fa2e3affed2084
Reviewed-by: hjk <hjk@qt.io>
2019-07-22 15:43:19 +00:00
Eike Ziller
4ce34fd90f Merge remote-tracking branch 'origin/4.10'
Change-Id: I88a6704fb8d723a3cbdfb1a2d9c84741f30d4da6
2019-07-22 09:34:47 +02:00
Christian Stenger
53ca9752e2 ProjectManagers: Avoid deletion of special files
Do not allow deletion or rename of files that are used
to define or manage projects.
This fixes issues of being able to remove or rename
pri and pro files of qmake based projects as well as
special files used by the GenericProjectManager.

Change-Id: Ib173abf04368f0625a9e481bb7290aa11933e62f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-19 05:43:17 +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
Eike Ziller
917636b88b Merge remote-tracking branch 'origin/4.10'
Conflicts:
        src/libs/utils/consoleprocess.h
        src/libs/utils/consoleprocess_unix.cpp
        src/libs/utils/consoleprocess_win.cpp
        src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
        src/tools/clangrefactoringbackend/source/symbolscollector.cpp
        tests/unit/mockup/projectexplorer/project.h

Change-Id: I8d10f26b9bcb54829ba31cdc2272885691df1e16
2019-06-18 12:30:55 +02:00
BogDan Vatra
8728057f15 Cleanup QBS plugin
Remove comments & debug messages.

Change-Id: Idcc03867e188de6fe258758b3d2cce22f1a1b732
Reviewed-by: hjk <hjk@qt.io>
2019-06-17 06:56:33 +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
Christian Kandeler
e59bcd9962 ProjectExplorer: Add a "product" tag to the ProjectNode class
A product is a project node from which a target binary is produced, such
as a Product item in qbs or a .pro file in qmake.

Change-Id: I6a0e6bed6c02684cb03b2b18fed6a1b493fa78b2
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 08:25:57 +00:00
BogDan Vatra
57c48630a8 Android: Add proper QBS support
Now we can use QtCreator to build, deploy, run & debug QBS projects.

[ChangeLog][Android][QBS] Add Android support for QBS projects.

Fixes: QTCREATORBUG-15573
Fixes: QTCREATORBUG-19880
Fixes: QTCREATORBUG-22182
Change-Id: I08b153a44dcf7ca178689c1c30fa2201c4cc0dbb
Reviewed-by: hjk <hjk@qt.io>
2019-04-26 06:37:00 +00:00
hjk
e3a7aa1ad2 ProjectExplorer: Flip default for ProjectNode::showInSimpleTree
Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:57:05 +00:00
hjk
729c74379a ProjectExplorer: Merge Node::isFileNodeType and asFileNode
They were identifying the same set of nodes.

Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:44:22 +00:00
hjk
ad4e2562fa ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are
several systems to identify or invoke node functionality.

Virtual functions are likely to stay in this context, so this
here attempts to help consolidation by reducing the influence
of the node type flags, hopefully leading to full removal
by making remaining functionality available through the
other mechanisms (virtual functions, asFooNode() 'casts',
less so the FileType flag).

Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:32:14 +00:00
hjk
f066af4c14 Qbs: Remove QbsBaseProjectNode layer
Change-Id: I7c43b0b04503d4c9a25c5fe758defc589655f387
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-27 12:09:12 +00:00
hjk
a2d9acb6ec Qbs: Remove QbsFileNode
It's a ProjectExplorer::FileNode with a custom constructor.

Change-Id: I3057647a5843141ef9e55c97dd19255ea454479a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 15:22:04 +00:00
hjk
44a42db1ae ProjectExplorer: "Upstream" line number display for FileNodes
So far only used and set with QBS, but conceptually usable more
generally, and harmless if not used.

Change-Id: I1d2d615f5613340690de22a1c7d716a193fb1f05
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 13:58:18 +00:00
hjk
5cc1aee7ff Qbs: Move QbsBaseProjectNode::showInSimpleTree()
... to QbsGroupNode::showInSimpleTree(). It's the only subclass
that didn't re-implement it.

It's easier to reason about the actual value when the value isn't
flipped too often in the inheritance chain.

Change-Id: I61f6020acc95a3dc0383b44ad8d40ee39f923d0f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 13:31:43 +00:00
hjk
f844f54cb7 ProjectExplorer: Use setters in ProjectExplorer::Node
Instead of constructor arguments. This makes it clearer on the
user side which value is actually changed.

Change-Id: I63ae8cd139a49700996c8874098111aad89ace22
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 08:26:43 +00:00
hjk
2b1b00d0e6 QbsProjectManager: Remove unused class QbsFolderNode
Change-Id: I94656ed4508084ecc9b2d0da623c6885b06341f1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-25 14:46:33 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Christian Kandeler
e9d3a9b1e8 QbsProjectManager: Implement ProjectNode::targetApplications()
Change-Id: Ied997dcb7e0a3d68b48bb7149f3494a2077ec014
Reviewed-by: hjk <hjk@qt.io>
2018-12-17 14:51:34 +00:00
hjk
18669c8215 ProjectExplorer: Reduce qmake specific logic
- add a QString FileNode::buildKey(), returning the build key
  for a build represented by that node, if any.

     * for QmakeProFileNodes the build key is traditionally equal
       to the file name, so use that.

     * for QbsProductNode use the uniqueProductName()

- add a Project::findNodeForBuildKey(QString buildKey) convenience
  function searching a Project(!)Node matching that build key.
  That's the only use case there is right now, and I see no reason
  yet to travers all files (yet).

Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-04 08:53:34 +00:00
Alessandro Portale
11632bbedd QbsProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override

Change-Id: I8a67b87e614f54554f9ca50c9f5e3f3297458ec1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-07-27 12:35:12 +00:00
Christian Kandeler
491b057d14 QbsProjectManager: Add new files to the top-level product
... by default. The "New File" wizard, if not invoked from the context
menu, implicitly prefers Groups over Products, because the respective
nodes are tried first. Thus, we lower the priority of group nodes so
that their parent product will be a better match unless the group was
specifically selected.

Task-number: QTCREATORBUG-20480
Change-Id: I0c5b2dbf861065ee97ab957ec8bd86132295893e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-28 10:46:38 +00:00
hjk
e20d620043 ProjectExplorer: Let RunConfiguration declare what nodes it belongs to
This feature in question is the availability of the "Run" button in the
context menu of certain project nodes in the project tree to run
something presumably related to/build from that (sub)project.

Previously, the decision was made for certain qmake based projects
(those targeting Desktop, iOS and VxWorks) by some indirection
through the corresponding RunConfigurationFactories.

The patch lets the RunConfigurations decide themselves directly
and removes the indirection, potentially opening the feature for
other qmake based RCs, as well as other combinations (e.g.
PythonRunConfiguration could be associated with its .py file,
without the need to have a dummy project)

Change-Id: Ic489bd1dfa25fcd9102ffa4fa30125565dd2e40e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 09:55:03 +00:00
Tobias Hunger
1cf1700d1c Core::FileIconProvider: Add helper method to get a directory icon with overlay
Add a helper method to request a directory icon with an overlay icon for the
project tree.

Change-Id: Idea2ea9ec2ea6790bf8d087723700364fbcafec6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-08 11:18:09 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)

Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.

Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-01 11:24:53 +00:00
Christian Stenger
bde8ebc56c QbsPM: Re-introduce uniqueProductName()
This patch prepares for enhancing information stored inside
buildSystemTarget.

Change-Id: I5d81fd01ab6b06c162f47fd9536de697ddfd24a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:14:39 +00:00
hjk
bd5e2faa75 ProjectNodes: Handle supported actions one-by-one
Getting the full list for a node can get quite expensive e.g. in
cases of recursive calls of QMakeProjectManager::findPriFile.

However, the FlatModel needs to decide quickly on whether an item
is editable to potentially allow renaming.

So split up QList<Actions> supportedActions() into individual
bool supportsAction(action) calls and make sure Rename is not
on the critical path.

Task-number: QTCREATORBUG-17953
Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 12:47:03 +00:00
Joerg Bornemann
848b8c0f44 Update qbs submodule
To HEAD of 1.8 branch, and adapt to changed API.

Change-Id: Ie180b114726134a06dfefe9dc3a6dc27997f246c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-31 14:44:49 +00:00
hjk
58214f09e3 QbsProjectManager: Code cosmetics
Remove unused QbsProductNode::findGroupNode and productPath.
Also, simplify setup of static icons.

Change-Id: Ibfaa1398eefcf3f764173d5b37aa4382b68976c9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-21 12:49:46 +00:00
Christian Kandeler
5090c2929a QbsProjectManager: Add missing assignment in QbsProductNode constructor
At least the "build product" functionality was broken because of this.

Change-Id: Ia552e53ba783b2b037ce7289d554e4061ed62262
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-10 15:12:09 +00:00
Tobias Hunger
45ffa75054 Qbs: Move root project setup into QbsNodeTreeBuilder
Change-Id: If8ba7fc6e4edf1346e0636d0bbc78efb27cb433e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-02 15:07:21 +00:00
Tobias Hunger
8cb57c734e Qbs: Move setup code for QbsProjectNodes into QbsNodeTreeBuilder
Change-Id: Ice5b445db916648bb8fb0d0f31bafe1d53e11182
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-02 15:07:14 +00:00
Tobias Hunger
5ed7728d46 Qbs: Simplify QbsProjectNode
Change-Id: I463407a38ed9acfc1332cbeb7cdc37f709c724d9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-02 15:07:08 +00:00
Tobias Hunger
b6b7605357 Qbs: Move ProductNode setup into QbsNodeTreeBuilder
Move closer to a setup where the project tree API can change.

This patch also makes sure "Generated files" will be below the
product file of each product and above any Groups/folders/files.

Change-Id: I728289372d40b809105f55adbe50fd424b19e0a0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-02 15:07:03 +00:00
Tobias Hunger
7b3db8ee1d qbs: Move setup of Group node tree into QbsNodeTreeBuilder
Move code to set up the tree of project nodes out of the project
nodes themselves. This makes them easier to manage and will enable
creator to change to a less update-intense project tree.

Change-Id: I2d0702d257e87543f47ebfb456344423ebe4f871
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-02 15:06:59 +00:00
Tobias Hunger
68b1859f58 qbs: Simplify add/remove file code
There is no need to call setupFiles on the QbsGroupNode before calling
update() on the root node. That will just redo the work anyway.

Change-Id: I54048395f87dd6fb5436f5d9d47b97e82460b568
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-28 14:24:59 +00:00
hjk
10b56f8930 QbsProjectManager: Replace some uses of Node::projectNodes()
No need to use two filters with a temporary list when the
task can be done in one go.

Change-Id: I96468099eb28c9698dbc637e432a38071d054e39
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 17:32:23 +00:00
hjk
04a525877b ProjectExplorer: Merge FolderNode's m_{file,folder}Node fields
One step closer to direct use of Utils::TreeNode.

Change-Id: Icd0dfd2fa4d12c2572a68f61ae43c5e906956a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-09 12:15:23 +00:00
hjk
cbfedd4328 ProjectExplorer: Fix display of .qrc contents
Change-Id: I2779e12daa8a7972380f51b72a56de3466d453a5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 13:43:31 +00:00