Commit Graph

389 Commits

Author SHA1 Message Date
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
Alexander Drozdov
dfaf01614d CMake: make project file system tree scanner persistent
Project source tree is a same for all build configurations so it is
a good idea to keep it persistent between CMake runs, configurations
switches and so on. It safes a lot of time for big projects.

Move more operations to the scanner thread:
 - Nodes filtering: skip .user files on top level of the project, skip
well-known extensions and octet-streams: In most cases these are not
required to be shown in the project tree.
 - Nodes sorting

Fix small memory leak: we have .user in the scanner result. After this
node filtered out, but is not feed (old code at the
BuildDirManager::generateProjectTree()). Now .user file skips during scan
without memory allocation at all.

Allow user manually rescan project tree by call Build -> Rescan project
tree. It runs CMake and Tree Scanner together: in most cases only CMake
run requires but time to time (VCS update) full rescan also required.

Change-Id: I4a6e6c897202da557509291c79932dd7751860e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-13 21:16:56 +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
Tobias Hunger
45ad669a88 CMake: Return empty tree on errors in server-mode
This triggers the fallback mechanism which will make sure the CMakeLists.txt
file will be displayed.

This used to fail since one empty folder was left over in the project.

Task-number: QTCREATORBUG-17383
Change-Id: I867fd9039bc5df805ff5174ec49084bbcf688824
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-05 16:21:30 +00:00
Tobias Hunger
53d45de8a0 CMake: Allow to build target from context menu of CMakeTargetNodes
Change-Id: I0457abd6dabea1699272482eb5f7fbb3ca097310
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 09:30:59 +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
Eike Ziller
30f71eddf8 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I245212bd45104636b1c9737b36d3db3e4af23092
2016-11-01 09:30:49 +01:00
Nikolai Kosjar
6e6d5b5309 ClangStaticAnalyzer: Tests: Rely on projects telling when they finished parsing
We relied on the CppModelManager to tell us whether a project was reparsed
after a kit change. While this worked, it was not guaranteed that the project
is really finished (and ready for e.g. building) after pushing new ProjectInfos
to the CppModelManager.

Rely on the projects telling when they are finished with parsing. This is more
accurate and future-proof.

The introduced signals in Project and SessionManager are (at the moment)
only for tests.

Change-Id: I1b368ec4585ffa8755eb28fac6d187cce31243ee
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-10-31 15:09:01 +00:00
Tobias Hunger
4798d038a4 CMake: Clear files when cleaning CMakeBuildTargets
Change-Id: I16fefae569f807776e422b4b662d5b42d1230df2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-17 13:48:52 +00:00
Tobias Hunger
9ff2bd16d3 CMake: Use Utils::FileName where appropriate
Change-Id: I3ab0a68920e27ebcf4e1dd58180a72ded58b892e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-17 11:41:51 +00:00
Tobias Hunger
9e67dfbe17 CMake: Move more code into BuildDirManager
Continue to concentrate all the code reading random cmake files in
BuildDirManager. Now the task is to clean up the code, make it less
dependent on values it should not depend on (kits, etc.), make it
handle changes better and finally add another implementation that
uses the cmake server mode to extract the data.

Change-Id: I533625e376b969b64287bc205bd2e4be7a605306
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-10 14:45:51 +00:00
Tobias Hunger
683b965297 CMake: Encapsulate BuildDirManager in CMakeBC
This will make it easier to introduce a new type of BuildDirManager
to accommodate cmake server-mode.

Change-Id: I989aab9df44dff1cfdff226ef97bb30bb092ffdd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:59 +00:00
Tobias Hunger
5481ca6edb CMake: Properly split QML_IMPORT_PATH
Change-Id: I0626da3a08e0e190757900a2df312ab0cee948d0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:47 +00:00
Tobias Hunger
653f60ae33 CMake: De-noise CMakeProject
Change-Id: I9d5df01d0d4699df30c1f01c0cfe7f3da310457a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:39 +00:00
Tobias Hunger
01149ad955 CMake: Remove unnecessary members from CMakeTargets
Change-Id: I6428496f4eab0d42f44525477c716f74714f8824
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:31 +00:00
Tobias Hunger
9b40c1fc04 CMake: Move code from CMakeProject into BuildDirManager
This is in preparation for having support for cmake's server
mode.

Change-Id: I6cc04fe7c5132c491c3f3c0f46560b8ad88808e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:16 +00:00
Tobias Hunger
69627e494b Add helper code to generate trees of project nodes
Add helper code to FolderNode that enables the creation of a tree
of File- and FolderNodes from a FolderNode and a list of FileNodes.

Change-Id: Iba4b6a768fc3d0501851f141372e7e34913ba518
Reviewed-by: hjk <hjk@qt.io>
2016-10-05 15:42:47 +00:00
Tobias Hunger
bb8cd10a04 CMake: Rename method
Change-Id: I6d30bdd7cf6d290f33601c766049e48c3def393a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 10:54:09 +00:00
Florian Apolloner
669d04a686 Massively speed up CMakeProject::buildTree
This is done by updating folders once and not per file.

Task-number: QTCREATORBUG-16930
Change-Id: I6c1959031e7ad774cfd22c7364c88e1d0bd32962
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-23 13:18:42 +00:00
Tobias Hunger
53747b76dd CMake: Do not process UtilityType build targets
Those produce no direct artifacts, so there is no need to check those

Change-Id: Ic10720c1f3c3a7b602c45b870bfd39604754ddee
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-25 11:35:46 +00:00
Tobias Hunger
bda9bf6755 CMake: Do not map all unknown build target types to "ExecutableType"
There is UtilityType now, so use that if there is no executable being
generated.

Change-Id: I9e8d512077b8352ec056b49c8db03644482b8fbc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-25 11:35:37 +00:00
Eike Ziller
b43765b3e8 Merge remote-tracking branch 'origin/4.1'
Change-Id: I5cacf96b5be4053d3a32a7c2a78fad463b9600d0
2016-08-17 15:14:57 +02:00
Tobias Hunger
906e81c745 CMake: Delete watched files when closing a project
Fixes a crash when re-opening a cmake project.

Change-Id: I5fc747f19787594964fe55c19e29e944c4a5092d
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-17 12:48:03 +00:00
Tobias Hunger
cb14fb0d71 Kits: Save several ToolChains per kit
BREAKS BACKWARD COMPATIBILITY OF TOOLCHAIN SETTINGS!

* Convert old ToolChainKitInformation to new version
* Store several toolchains in one kit (one per language)

Change-Id: Ia59a2ad067c57971ec34ce9b2e43758344443755
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-14 15:34:06 +00:00
Tobias Hunger
703c410085 CMake: Only start parsing when creator gets focus again
Rip out QFileSystemWatcher and use Qt Creators IDocument for file
watching instead. The latter properly delays any action till creator
gets focus again.

Task-number: QTCREATORBUG-16354
Change-Id: Ibb71963416b09712a80ee95347425550453b7fd4
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 09:10:02 +00:00
Tobias Hunger
069bb2d359 CMake: Work around cmake reporting include paths in random order
Work around cmake reporting include paths in random order to Qt Creator
due to a bug in the CodeBlocks generator.

Remove the tool chains include paths from the list reported by cmake and
have the code model add those again later. That keeps at least the
include paths of the compiler in order, which is important as this
makes sure any fixed headers shipped with the compiler actually get
picked up.

Task-number: QTCREATORBUG-16432
Change-Id: I218735914bcc750ce87b02b05d111f3fe2bb5644
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-15 08:11:40 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Tobias Hunger
5bc0d12c6d CMake: Check CMakeCache.txt for changes
Check CMakeCache.txt for changes and ask whether to apply these to the
project going forward.

This will only consider settings that were previously changed by Qt Creator
and will not pick up on newly changed settings.

Change-Id: Ia20c67bc2a5e9965243f08003c10ec684875387f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:18:47 +00:00
hjk
602d899e0f Move CustomExecutableRunConfiguration to ProjectExplorer
There's nothing QtSupport specific in there.

Change-Id: I616a37ed56f1853cdbb16f483de5682d5ea63715
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-13 11:03:06 +00:00
Wolfgang Bremer
2f301bc45b CMake: Update qmljs codemodel
With this patch it is possible to specify QML_IMPORT_PATH in
CMake projects and QtCreator will scan those paths.
One only has to make sure that the variable which is set in the
CMakeLists.txt is also added to the CMakeCache.txt

Task-number: QTCREATORBUG-11328
Change-Id: I11c7694806664d3203d855983e7db4a89fac267d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-04-29 09:08:05 +00:00
Tobias Hunger
83ae0cb934 CMake: Mark cmake as imperfect and disable RunConfigurations as necessary
CMake does not know whether a build target was configured out of the
current build or removed entirely, so implement the relevant marker.

Mark all of the "vanished" RunConfigurations as disabled.

Also remove one unnecessary level of indirection when setting up
RunConfigurations.

Change-Id: I30a21581823b4bff5a5be29480e64423b9379983
Task-number: QTCREATORBUG-15950
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-07 09:57:20 +00:00
Tobias Hunger
44aaec767f CMake: Simplify cmakeproject code a bit
No behavior change is intended in this patch.

Change-Id: I5c49a0a97ede443dbb25bf34b96c346a63f549d2
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-06 08:11:10 +00:00
Tobias Hunger
6ea1b07ceb CMake: Simplify reparsing code
This still fixes the parsing issue when switching build configurations,
but the code is simpler.

Change-Id: I5748788224c5b49399550c33bcef592f193cfa8a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-01 09:56:27 +00:00
Tobias Hunger
76a050cb83 CMake: Move BuildDirManager from the project into the buildconfiguration
Change-Id: I90126ff22dd394eba4145db142b3914d211af476
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 12:17:31 +00:00
Ulf Hermann
2b48a4fa27 QtSupport: Support qscxmlc as extra compiler
Change-Id: Ief4810abe46ce4654f518781ce377e10a8e38ad4
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 12:53:15 +00:00
Ulf Hermann
2e3e060520 Generalize support for extra compilers
Allow for different extra compilers which may get called to generate
additional code for the code model. The build system is expected to
know what files are generated from which source file and the extra
compilers know how to generate the content of those files, without
touching the build directory. the uic adapter is refactored to be
the first such extra compiler.

The extra compiler is run when an editor for its source document
loses focus, or after a timeout of 1s when the source document has
been changed.

Change-Id: I13c110c61120c812f02639a3684144daf8979b37
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 12:53:05 +00:00
Tobias Hunger
181f62c84a Make: Speed up reading compiler flags from build.ninja
Scan through the build.ninja file once for all targets instead once
for each target. This improves CMake project loading speed for
projects with many targets and a large build.ninja considerably.

Change-Id: I857c48a714dbb39a469f81c1f951a77f2f57578e
Reviewed-by: James Legg <jlegg@feralinteractive.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 09:41:26 +00:00
Niels Weber
68fe98abdf Silence a warning
Change-Id: Ie59da76a14c39208356268e601aef3ba6b5d245a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 09:39:17 +00:00
Tobias Hunger
a8c2abeaa5 CMake: Register files with the locator again
Change-Id: Ib3a42c22bfac18630b968cfd78744c7827ef7fad
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 15:58:57 +00:00
Tobias Hunger
0d10ce3834 CMake: Disable BC if there is an error during initial cmake run
* Disable the BC and give report the cmake error
* Show a warning label in the BC

Change-Id: If5737d033fa2682c264ab7ac1189c59947e3b28d
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:19 +00:00
Tobias Hunger
744008ccf0 CMake: Store CMake project configuration in CMakeBuildConfiguration
Store CMakeConfig in CMakeBuildConfiguration instead of the list of
initialArguments.

Update initialArguments to a list of settings on load.

Change-Id: If58fc38296a4627f40062dd407e684c8a9477f6e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:15 +00:00
Tobias Hunger
28e4306865 CMake: Add UI to display and edit cmake configuration
Change-Id: I95944dcd58dc86023c2757068979f92b8989011b
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:11 +00:00
Tobias Hunger
761d480453 CMake: Do not ask to rebuild after editing CMakeLists.txt files
This happens automatically now, do not bother the user with that
anymore.

Change-Id: Icc411e74ea5de42037f3718c6b75cc15772a64b9
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:05:12 +00:00
Tobias Hunger
859bf2c5ce CMake: Do not run a cmake wizard all the time
Do not push the cmake running straight into the face of the user. Do it
in the background instead.

This needs some follow-up patches to become really useful.

Change-Id: I3457178b33e3f14bdeac25005a773d17abb73b65
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:04:45 +00:00
Tobias Hunger
fe944e47e7 CMake: Simplify code a little
Change-Id: Ifdfac9bb844c9ab201378a6047714ab64ccebd66
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-01-22 12:34:42 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Marco Bubke
ddd1d4c9cc CppTools: Remove cpptools/cppprojects.[h|cpp]
Change-Id: Ida0e8552d371972c141cf561b28667f4428c6fff
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-13 14:47:27 +00:00
Tobias Hunger
d144ea58e0 Project: Add setRootProjectNode method
Add setRootProjectNode method and a default implementation of
rootProjectNode to Project. Use that in all derived classes.

Change-Id: Id28cde04457a20a8963d43020785ef9d77fea57c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-11 15:33:26 +00:00
Tobias Hunger
219b2d9c16 Project: Do not save filenames in derived classes
Change-Id: I23960c61676e96c429b59ad8f8247e1b88606b1a
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-11 15:33:11 +00:00