Commit Graph

40 Commits

Author SHA1 Message Date
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Christian Stenger
27cb331b4b AutoTest: Avoid guessing run configuration
Base the selection of the run configuration on the executable
we have gotten already from the BuildTargetInfo and take
deployment information into account.

This also reverts cce1e130 partially and avoids
stuffing unrelated information into the buildsystemtarget.

Change-Id: I3de6e910a5fd1092d428ec4afc33c4ca62daaa25
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-31 06:11:35 +00:00
Claus Steuer
bf10378992 CMake: Fix cmake config can't be changed by user in tealeaf mode
Changes to the cmake configuration (via projects page) are not applied
in tealeaf mode.
The tealeafreader::parse method passes changed config parameters to
cmake only if the .cpb file does not exist. Since that file always
exists after project initialization the user can't change the cmake
config anymore.

Make tealeaf reader pass changed config parameters to cmake when
a reparse is forced. This restores the behavior from 4.2.2

Change-Id: I31ffad32d176e6290064b55758e4df96d2ffe6bc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-19 04:30:38 +00:00
Claus Steuer
13bcdf700d CMake: Set project file location in tealeaf mode
The tealeafreader creates a RawProjectPart for each cmake build target.
However, the location of the CMakeLists.txt is not set/added to
RawProjectPart::projectFile and RawProjectPart::buildSystemTarget.
Both properties are required by the AutoTest plugin to map
run configurations to test configurations.

Make tealeafreader use the same code as the servermodereader
to determine the location of the CMakeLists.txt.

Change-Id: Ia35444799bcd3c46f84ad897044cae56c1aa16ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-19 04:30:19 +00:00
Tobias Hunger
64c5f960e8 CMake: Return an empty project tree if parsing failed
This triggers the logic in Project to show the top level project
file in the project tree.

Remove similar logic in CMake.

Change-Id: I2bfdd3f5e3d4126910a3feb480cec5ef689954ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Florian Apolloner <florian@apolloner.eu>
2017-06-23 09:56:07 +00:00
Claus Steuer
523439d71b CMake: The first build of a cmake project always fails in tealeaf mode
The TeaLeafReader tries to parse the CMakeCache.txt before cmake is
executed for the first time.

The error is signaled to the CMakeBuildStep which reports the build as a
failure.

Make TeaLeafReader::takeParsedConfiguration return an empty
CMakeConfig object if the CMakeCache.txt file does not exist instead,
but do not report an error.

Task-number: QTCREATORBUG-18290
Change-Id: Ibfc43858938477ae7479029e8fe6786c77823014
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-20 13:37:17 +00: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
Tobias Hunger
6886b59fe6 CMake: Filter duplicate files from tree in tealeaf mode
Task-number: QTCREATORBUG-17955
Change-Id: Ibd19c7a0d398f3f26d63983ec024722933485513
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-19 08:01:50 +00:00
Tobias Hunger
175643fd7e ProjectNodes: Do not define a copy constructor for FileNode
Nodes are QObjects (still), so they should not have a copy constructor.

Change-Id: I1b20663ee0ec121cda4d39ced7a9f204fb4621a1
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:27 +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
6e91fe5046 CMake: Use a CMakeProjectNode as top level cmake node
Change-Id: I6e68b971cf490b9b064a2866bd99865a7f4a7bd9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-15 10:23:09 +00:00
hjk
4d8352a6c1 ProjectExplorer: Add a FolderNode::addNestedNode() function
Also, rename buildTree() to addNestedNodes(), it's really
adding things, not recompletely (re-)building the subtree.

Use it whenever possible to avoid intermediate lists of items
to insert.

Change-Id: I5fde41e5b164a8a292410bd381a85f5efadf3471
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-14 12:26:22 +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
hjk
8b5b1f1de7 CMake: Move CMakeProjectManager::findCbpFile to tealeafreader.cpp
That's the the only user of that code.

Change-Id: Iabc6a1fa9a4ad05c467e8ed64386d3185de25f02
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 11:59:07 +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
Tobias Hunger
c09b3709b9 CMake: Reimplement CMakeCache.txt parsing in BuildDirManager
The CMakeProjectImporter will need that in addition to the tealeafreader.

Change-Id: I453a7a124b5303e163e9c85bc3fc215215617119
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-10 10:33:56 +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
Tobias Hunger
36a49ed103 CMake: Set project file information (when available)
Change-Id: I854a0207bd8568bc8f324840cba52dfb3ca880e9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-27 14:53:06 +00:00
hjk
beaba559a5 ProjectExplorer: Slim down user side ProjectNode handling
Change-Id: If727ff6cd09cc127e031c49c47f61ffda631a80e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 15:24:57 +00:00
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +00:00
Tobias Hunger
1b2fc1c815 CMake: Pass const QList<const FileNode *> to Directory Readers
This makes sure they need to copy whatever they need.

Change-Id: I767ac0c5f54ca1f9f46acdefe4bd7fea35657312
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-21 14:19:36 +00:00
Christian Stenger
95fa59dd6c Cmake: Fix regular expression
Change-Id: Ibcd5f62ace4adb4516ecaeba987eb8747996ba04
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-13 05:44:44 +00:00
Tobias Hunger
4f8769d844 CMake: Tealeafreader: Emit start signal before actually starting
This way we will get the start signal before the done signal if something
fails early.

Change-Id: I015017fdba16dd84f830b2e1fe2742eb0bec02a0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-05 09:22:50 +00:00
Tobias Hunger
63c0fbc4e4 CMake: Cache cmake configuration only once
This fixes saves memory and fixes some update issues with the cmake
configuration, where the three layers of caches used to interfere
with each other.

Task-number: QTCREATORBUG-17360
Change-Id: I5564bbe46ca8de6b38dd710100bfc18fad98eac5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-02 12:00:09 +00:00
Tobias Hunger
49e255c4d5 CMake: Check result of file open
Change-Id: Ia4a11359f7cb08ee3fa55c77dc54d42890f37845
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-30 14:24:55 +00:00
Alexander Drozdov
651460cd8d CMake: separate processing C and C++ flags in TeaLeafReader
C and C++ flags holds at the different variables/compiler settings in
the generated Make and Ninja files.

Currently only C++ Flags processed and assumes that same one uses for
C lang. But now QtC core can handle C and C++ separatelly, so just
add processing for that flags and use it for code model.

Change-Id: If1f71a2c58284a46324f04e962fc120cc316b0fb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-25 13:59:20 +00:00
Tobias Hunger
591d693d0d CMake: Move code to read CMakeCache.txt into CMakeItem class
Change-Id: Ie5d76a2b50007c80d68b2e97d3339a582afce469
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-17 13:10:47 +00:00
Tobias Hunger
e37539a16c CMake: TeaLeafReader: Simplify code
Change-Id: Ib615fde89952848c4cfe392a2e84c15f6b73de80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 12:30:43 +00:00
Tobias Hunger
ff68d4cab1 CMake: TeaLeafReader: Fix include path detection
Change-Id: Ifcd64836aef7fc69b3cc0d4c27a07293348b91a6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 12:30:39 +00:00
Tobias Hunger
4b4dc9d06c CMake: Project tree for server mode data
Change-Id: Ief884a76c1b4211501dd6515b17b6e88a8e881e5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 10:29:53 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Tobias Hunger
ae46c06ac6 CMake: Show scanned header files in project tree (TeaLeafReader)
Change-Id: I06ed341a603f4062b41eabc91a90d6d8041aaa4b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:37 +00:00
Tobias Hunger
269e699fd9 CMake: Pass scanned files on to builddirreaders
Change-Id: I226aeafe6800a84fe4bbf8cf6fd21b8237575a88
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:28 +00:00
Tobias Hunger
4c3885a584 CMake: Polish TeaLeafReader
Change-Id: If379e1d53f2da61dccb1e72ea1a516e3bd788b60
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-04 10:21:29 +00:00
Tobias Hunger
ce3e586198 ProjectExplorer: Shorten space needed to store a FileType
Use class enum to shorten the FileType to quint16. This frees up a couple
of bytes per FileNode and we can have many of those.

Change-Id: I3a9ae25059690fefa15305a4268269647d6dc1c9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-03 15:55:39 +00:00
Tobias Hunger
6ad21cab82 CMake: Small updates to tea leaf reader
Change-Id: Ie68ed562415ee0024254729ea95591b59bb8f0cf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 13:03:39 +00:00
Tobias Hunger
73dee5193c CMake: De-noise TeaLeafReader
Change-Id: I387bf0e1cc123d78591f95aacecb7be05c7455c2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 13:03:34 +00:00
Tobias Hunger
36cfa32a86 CMake: Use ServerModeReader to retrieve data
Change-Id: I415dbf7ca79c909eea23ef3dc3a1d87438e9f261
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 13:03:27 +00:00
Tobias Hunger
e3c1e7ade3 CMake: Unify mapping of type strings to CMakeConfigItem::Type
Change-Id: I29b905aac8965039369891e6aad7e356fa1dad8f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 13:03:08 +00:00
Tobias Hunger
9a980adf3c CMake: Implement different backends to run cmake
Only the original one is implemented so far, but at least
in theory backends for retrieving data from cmake can now
be switched at runtime.

Change-Id: Id73a81c7d40f078be95defd30a38511dca3a3720
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-10-31 10:40:24 +00:00