Commit Graph

354 Commits

Author SHA1 Message Date
Tobias Hunger
09b127f9f1 Project: Move signalling of parsing state into Project
Get rid of duplicated code to do such signaling in derived Project types.

Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:21 +00:00
Eike Ziller
e4a6267036 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/shared/qbs

Change-Id: I521ed7703298062d3860ddce3c82444bedd49e60
2017-06-28 10:28:16 +02:00
Tim Jenssen
56db0df2e6 Qbs: Fix crash when renaming files
Fix a crash when using file nodes to change the project. The methods used
to take const references, with the data living in the nodes of the project
tree. Since the methods change the project tree and thus cause the tree to
be rebuilt, the original data may get lost. So copy the data instead.

All the qbs::*Data classes are using shared data, so the overhead is not
too big.

Task-number: QTCREATORBUG-18440
Change-Id: I45ca5403a04e17790416dfe15b836f12c732e824
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-26 14:13:07 +00:00
Orgad Shaneh
687466ac47 Merge remote-tracking branch 'origin/4.3'
Change-Id: I126f3a05212a3d5df78812e66285bc9e8078360b
2017-06-20 11:32:02 +03:00
Christian Stenger
cce1e130d7 AutoTest: Fix handling of multiple build targets
If project files are not mapped 1:1 to targets the result
of the chosen executable was more or less random.
Try to handle multiple targets as correct as possible by
checking for build targets already where we still know
which files are part of the respective test cases.

Task-number: QTCREATORBUG-17783
Task-number: QTCREATORBUG-18357
Change-Id: I82dcc26bf52c9918e2727b439a719af08879ef49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 08:14:55 +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
Christian Kandeler
70e6bb2827 QbsProjectManager: Allow to import builds
Task-number: QBS-1059
Change-Id: Ibf45fbd870eb22f79883331f6559e1487df25ad0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-16 16:02:01 +00:00
Christian Kandeler
b5c8428285 QbsProjectManager: Delete ProjectDocuments along with project
The documents have a reload callback that accesses the project. This
would lead to a crash on a reload for a document belonging to a closed
project.

Change-Id: I171cacd0da347fb279609baaea4050ba1cc12008
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-15 10:00:40 +00:00
Christian Kandeler
7ffdcd102d QbsProjectManager: Make the configuration name explicit
This is a prerequisite for being able to import builds.

Change-Id: I22bd8f201db943335edadc899bfe9fa64d39e845
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-14 09:11:56 +00:00
Eike Ziller
64b19af7dd Merge remote-tracking branch 'origin/4.3'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6d89ea588de955f5d878500b59285d3adde6c77d
2017-05-15 15:31:55 +02:00
Tobias Hunger
2b4715c208 QbsProject: Use deleteLater to free QObjects
Change-Id: I33af237b271f32adc606befef081b97ded5e67ff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-05-09 13:21:16 +00:00
Eike Ziller
105b69836c Merge remote-tracking branch 'origin/4.3'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Id8b53b000f94a1b5ab923db79f67bad3276d09dc
2017-05-04 10:03:50 +02:00
Tobias Hunger
7c8125b480 Qbs: Set displayName from rootProjectNode
Set the displayName of QbsProjects from the rootProjectNode if that
exists. This fixes the project name not updating based on the name
set inside the qbs files.

Extract that into a new method so that it can be used consistently.

Task-number: QTCREATORBUG-18100
Change-Id: I417264ee8843a9e0665bbc190f1dbc7869eed0e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-04-28 14:17:18 +00:00
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
Christian Kandeler
b2be9b5b0a QbsProjectManager: Add "clean" and "rebuild" actions for products
... and sub-projects. We used to have only the "build" action for these.

Task-number: QTCREATORBUG-15919
Change-Id: I31d06498c0cdadb8a8738be521a98e8b03de32ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-04-11 12:15:52 +00:00
Tobias Hunger
0951589420 Project: Unify handling of displayName
Unify the handling of displayName with a proper changed signal across
all projects.

Change-Id: I7e503528854b85f6f38de4b0943775f82a0d6123
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-04-07 14:49:51 +00:00
Orgad Shaneh
173cb9f20e QbsPM: Fix size_t -> int conversion MSVC warning (64bit)
Change-Id: Ib1f79c2e0e203c5cc6cfaadac0b3ae1ee09d88b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-02 05:08:16 +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
Tobias Hunger
b0c7bb0f7b Project: Move ProjectDocument setup into Project class
Change-Id: I5c0ec79ddf066e37660fb9a6b24f9d882355d511
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:53:24 +00:00
Tobias Hunger
348aa12eaa ProjectExplorer: Provide ProjectDocument and use it in all projects
Change-Id: I6e054ebf1043bd1f6748f1567f35c68394bd6528
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:03:34 +00:00
Tobias Hunger
fc5ce1e710 ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based
on the project tree.

Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.

Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-27 15:32:13 +00:00
Tobias Hunger
802eff3485 CppTools: Add target information to ProjectPart
This is important to be able to map sources to actual things that are
going to be built.

Change-Id: I1aef940767d60192642ed79a1703cff8dfdad9e1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-15 11:03:45 +00:00
Tobias Hunger
49fef0ae24 ProjectExplorer: Create initial project tree
Create an initial project tree with a ProjectNode and a FileNode for
the project file itself.

Fix the Projects to not implement their own tree before they have
better data.

Change-Id: I147ccd5603d22d1d60880a97f30fd8c271eac88c
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:31 +00:00
Tobias Hunger
2fde3fffa9 Make all projects generate a fresh project tree
Do not update the existing project tree anymore: Start a fresh one
and throw the old one away.

Change-Id: Ifabe293b6ca668b0672516a6d81acd5346d98fe5
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:26 +00:00
Nikolai Kosjar
8a076e3f4b CppTools: De-duplicate and rename function in ProjectPart
Change-Id: I675ce4c9059d8ae4046f6a13aa7c04b88141d443
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 14:35:29 +00:00
Tobias Hunger
546df41853 ProjectPart: Add callGroupId
Do not rely on the projectfile being unique anymore.

Change-Id: I52e63b3ac8aeca43ef70af1d59d1d8612bd3540e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-03-09 13:50:08 +00:00
Tobias Hunger
cee92463f7 ProjectPart: Allow for line/column information in project file
Keep this information separate so that plugins using the information
do not need to start parsing the project file.

Change-Id: Ibecf431de1b12bbe820c6f8f9c986cffeb4972d2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-03-09 13:49:36 +00:00
hjk
c1bfc5d8ec ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 10:41:33 +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
hjk
be204a125e ProjectManager: Cut ties between Project and IProjectManager
Not needed, less code.

Change-Id: Ie0d5c3a60f0392f30ed2ee9d2c5a32156b4e67e1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 17:07:05 +00:00
hjk
8fd17a84b5 ProjectManagers: Cleanup
Remove unused class members, declarations, includes, unneeded
::projectManager overloads etc.

Change-Id: I0f4ae87414faca226554722e2a9147cb5512495d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 16:15:03 +00:00
hjk
4d3d2d0dfb ProjectExplorer: Remove Project manager parameter from some constructors
Can be done generically when creating projects. The only wart is
the use from BaseQmakeProjectWizardDialog::writeUserFile.

Change-Id: Ie98c9f88ec142e82443e204a0075e3ae9e163752
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 14:56:21 +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
Eike Ziller
dbb2288f1a Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/shared/qbs

Change-Id: I05c4945d238b7724ca73477fc3b21554564951c0
2017-02-20 15:20:14 +01:00
Nikolai Kosjar
6ba90cd06a QbsProjectManager: Set proper Qt version for C++ Code Model
Change-Id: I04b5524e971e5617a9bae88c1fcab087d62d7a73
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-20 13:54:36 +00:00
Nikolai Kosjar
8c90998fff CppTools/ProjectManagers: Reduce ui blocking when loading projects
${AnyProject}::updateCppCodeModel() did two potentially not that cheap
operations in the ui thread:
 (1) Querying the MimeDatabase for the mime type for the source files of
     the project. In 99.9% of the cases no files need to be read for
     this as the file extension will resolve the type. The expensiveness
     comes from the sheer number of files that can occur.
 (2) Calling compilers with the "(sub)project's compiler command line"
     to determine the macros. While the caches avoid redundant calls,
     the number of the unique compiler calls makes this still a
     ui-freezing experience.

These two operations are moved into a worker thread. For this, the
expensive compiler calls are encapsulated in thread safe lambdas
("runners") in order to keep the "mutexed" data minimal. The original
API calls of the toolchains are implemented in terms of the runners.

While adapting the project managers, remove also the calls to
setProjectLanguage(). These are redundant because all of the project
managers already set a proper value in the constructor. Also, currently
there is no need (client) to report back detection of C sources in
project parts. This also keeps CppProjectUpdater simple.

There is still room for improvement:
 * Run the compiler calls in parallel instead of sequence.
 * Ensure that the mime type for a file is determined exactly once.

Change-Id: I2efc4e132ee88e3c8f264012ec8fafe3d86c404f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-20 09:18:13 +00:00
Christian Kandeler
a7ed20faaa QbsProjectManager: Do not interpret Project::GeneratedFiles literally
The files retrieved by calling Project::files() with this flag show up
in the locator, in search results etc. So only consider files that we
know to be human-readable.

Task-number: QTCREATORBUG-17382
Change-Id: I7a66159e67207a09adb57b0c5584b0b067fd1fca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-02-16 12:24:15 +00:00
Nikolai Kosjar
e2e78c6a5d CppTools: Distinguish between ProjectFile::{unclassified,unsupported}
There was no way to determine whether ProjectFile::classify() was run or
not. Now, ProjectFile::classify() returns ProjectFile::Unsupported
instead of ProjectFile::Unclassified.

Change-Id: I660d0e42044bdefcac38058c6f4a3425983a6d93
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-02-02 14:46:13 +00:00
Ulf Hermann
c70b689526 Unify projectexplorer language IDs
We don't need two IDs for C++ and the QmlJS ID should look the same as
as the others.

Change-Id: Ib9747f6b36a90bb652951d85eec69666615670c4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 15:34:46 +00:00
hjk
30bf801629 ProjectExplorer: Further tree node related simplification
Drop the list sorting and difference generation which is not
needed in the "build from scratch" setup.

This also removes some of the intermediately introduced
convienience functions and fixes a regression that led to
missing project files.

Change-Id: I39d1966324917f466fb347da3a52552393ca4a01
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-30 07:56:05 +00:00
Christian Kandeler
5b67e4de94 QbsProjectManager: Profile some operations
We want to know how much time the various update functions take that run
after a qbs job has finished.

Change-Id: I1bc6d1287108e5d70d15b41f2b544b22e2315a88
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-01-27 12:03:54 +00:00
Christian Kandeler
1b67f9eafd QbsProjectManager: Fix false positives when classifying files
... for the C++ code model. In particular, a file ending in ".h" must
not be unconditionally classified as an "ambiguous header", but only if
it has the "hpp" tag.

Change-Id: I33a463de78525fb965e781b4b75d1e088c055c3d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-24 14:53:25 +00:00
Eike Ziller
b1e2d5b693 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ib3073a0a3d80c99cf97b9839480dbf9583fa10de
2017-01-23 13:13:14 +01:00
Christian Kandeler
014167c8e8 QbsProjectManager: Remove duplicate include paths for the code model
Task-number: QTCREATORBUG-17381
Change-Id: Iabf1cdfe7988181e0e20396c5a5ec02e51e27f44
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-20 16:48:38 +00:00
Eike Ziller
8d08c601d5 Merge remote-tracking branch 'origin/4.2'
Change-Id: If9b3a860d7efb561bb710d49396d6bbe13809aa1
2017-01-12 10:54:48 +01:00
Tobias Hunger
a0125a6e6d Qbs: Fix warning about unused variables
Change-Id: If0659e83a188b4b76d3ae80bcbd4319c02b655da
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-01-11 10:15:34 +00:00
Nikolai Kosjar
3a369552c6 CppTools: Classify ambiguous headers depending on other files
This applies for all project managers, except qmake. The qmake project
manager will make use of this in follow up changes.

Before, "foo.h" was always recognized as a CXXHeader. Now, it depends on
the other files. E.g. in a file list {"foo.h", "foo.c"} foo.h is now a
CHeader. In {"foo.h", "foo.c", "bar.cpp"} the file "foo.h" is ambiguous
and we will create two project parts, one where it is a CHeader, the
other where it is a CXXHeader.

Change-Id: I50505163368742584b1380c284d42cbe07cb4fc9
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-12 13:49:09 +00:00
Nikolai Kosjar
a80273edf0 QbsProject: Adapt assert
It fails now because with

    commit 521423b433
    CppTools: Call ProjectInfo::finish when we get it

the ProjectInfo is always changed.

Change-Id: I2c57cca330f42326d068e5077fc303d172b1be62
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-07 13:33:17 +00:00
Nikolai Kosjar
521423b433 CppTools: Call ProjectInfo::finish when we get it
No need to require the project managers to do this. Also, it is easy to
forget.

Change-Id: I96f7a5e5547418678af9653e5753c372f0880e5a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-06 14:34:39 +00:00
Christian Kandeler
c7e6054601 QbsProjectManager: Fix potential crash
Iterators 101: Make sure begin() and end() are called on the same
object.

Task-number: QTCREATORBUG-17339
Change-Id: Id757918e20a0a5017dc2135757f96f446abe0f48
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-24 09:47:55 +00:00