Commit Graph

224 Commits

Author SHA1 Message Date
Tobias Hunger
2513116406 qmake: Fix WS
Change-Id: Ied361023444e21575504d2175c36fefd02e43752
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-17 12:51:38 +00:00
Tobias Hunger
69684d9f9c qmake: Rename QmakeParser*FileNode to Qmake*File
Change-Id: I7598ccf93ed21a6d6650db76b17d745a2739b18c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:02:04 +00:00
Tobias Hunger
528b5f2298 qmake: Use enums from Qmake*File over those in Qmake*FileNode
Use QmakeParserProFileNode::AsyncUpdateDelay instead of
QmakeParserProFileNode::AsyncUpdateDelay.

Change-Id: I6628e566ce0f289778d61d146df58ca31345cdd7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 09:02:52 +00:00
Tobias Hunger
b697fd0db4 qmake: Use Variable enum consistently
Change-Id: I89588f12600f0698de764c05c1930b13b53a2588
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:16 +00:00
Tobias Hunger
086733a2c9 qmake: Use ProjectType enum consistently
Change-Id: I633a7150202fcbf420a33b4173d2b4451f46eb11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:11 +00:00
Tobias Hunger
0b6eb21388 QmakeProject: Fix CentralFolderWatcher
Make the loop actually iterate over something:-)

Change-Id: I9e7ff40c3e5c3860a99bca15e381c1e12eed4d51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:39:29 +00:00
Tobias Hunger
bfa456072c qmakeProject: Use nullptr
Change-Id: Idad0ace2ae264beff29864cb20cb1a7b67d16ac6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-14 14:39:43 +00:00
Tobias Hunger
e98f5ae226 QmakeProject: Remove some debugging code
Change-Id: Ia4266d568074023edfe40177e1e6a35186d935dd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-14 14:33:13 +00:00
hjk
95e2d7f545 ProjectExplorer: Remove ProjectNode::m_projectNodes
They are duplicated in m_folderNodes, use them.

Change-Id: I4571720f1ef3daf098870a3cf05fa28a1002bb3f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-08 11:15:55 +00:00
Tobias Hunger
b139b057a1 QmakeProject: Polish class
Use final, get rid of some useless headers and debug code

Change-Id: Icb1110f6eda4e17d143d8bdf17167d6c3046b884
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 15:28:17 +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
Tobias Hunger
e8b4e180cd RunConfiguration: Introduce buildSystemTarget()
Introduce a method that maps a RunConfiguration to the build system target
that created the executable.

Implement the method in all RunConfigurations where that makes sense (e.g.
no CustomExecutables).

Change-Id: Ifaac859c2cd9b2806a0d7c185b2239312a67752a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-30 13:27:16 +00:00
Oswald Buddenhagen
8288ca1251 make more use of BaseQtVersion::qmakeProperty()
... instead of peeking into versionInfo().
in fact, make versionInfo() private, to avoid subsequent deterioration
as happened before (after 5e596e89d).
some other functions that use it in its interface also become private.

this fixes several breakages related to working with non-installed
prefix builds of qt.

Change-Id: Ib67de79323c9e38f3de48a09854b155de9eef5b2
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 14:01:06 +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
25fbcca96b KitManager: Get rid of KitMatcher class
Use std::function instead. Clean up API while at it.

Change-Id: I6e401ab57f5375e36710c30508c596af3f4b3385
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-18 10:39:16 +00:00
Tobias Hunger
6553c3c99e BaseQtVersion: Allow for a predicate when retrieving Qt versions
Make methods used to retrieve Qt versions from the Qt versions manager
take a predicate to select the interesting version.

Change-Id: I9218c57bae6d5033d49d618dfc0da41fe578444d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-17 13:13:48 +00:00
Eike Ziller
b1f1ccb32e Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: I3484b668f9323ed0c05de99f8dfed07c9e65ab98
2017-01-11 09:29:37 +01:00
Orgad Shaneh
ffabc5dff1 QmakePM: Fix false positive warning for incompatible compiler
Some users set 'QMAKE_CXX = @echo $< && $$QMAKE_CXX' to prettify the
compiler output.

Another useful case for "incompatible" compiler is ccache, or other
compiler wrappers.

To eliminate warnings for these cases, pick the last value of QMAKE_CC/
QMAKE_CXX, excluding flags, and compare it against the configured toolchain.

Change-Id: Idc3b9377e6f7c39c09c50f36ec89460756510b97
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-04 09:26:29 +00:00
Nikolai Kosjar
0265442c93 QMakeProjectManager: Use ProjectPartBuilder
...as the other project managers.

This removes extra code paths, duplication and improves classification
of source files (ambiguous headers).

Change-Id: Iae05cbbc61ab2e5dd841ae617bec994e0a1e52d5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-13 14:55:36 +00:00
Nikolai Kosjar
602ad72d42 CppTools: Refactor ProjectPartBuilder
...and add some basic tests.

Introduce the abstractions ProjectInterface and ToolChainInterface in
order to break the dependency to the ProjectExplorer. Also, some simple
logic can go there to simplify the (Base)ProjectPartBuilder.

Change-Id: I6c50a1804ce62098b87109931eb171f5c2542937
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:04 +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
05942b63f8 CppTools: Do not put configuration document into global snapshot and working copy
These are remnants of the time when we had only one snapshot.

Change-Id: I6ff4db645d1065a0ef195834890e0774e2e2c60e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-12-08 08:52: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
Nikolai Kosjar
d006fc4149 QMakeProjectManager: Clean up updateCppCodeModel()
Change-Id: I083a6ed91d78ee278977128ec0f19ed28d0eeae4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-06 14:34:33 +00:00
Nikolai Kosjar
458e775f88 QMakeProjectManager: Remove unused function
Change-Id: I47f598f5de364f8039de910894747b2d66ceba0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-06 13:55:18 +00:00
Francois Ferrand
38ae5aec10 C++: Fix handling of Objective-C/C++
- Objective C/C++ was not enabled in highlighter.
- QMake project part for Objective C/C++ did not have ObjectiveC extension enabled.
- As languageFeatures.objCEnabled is a bitfield, it was actually always set to 0.
- Highlight ObjC class & protocol declarations.
- Highlight ObjC message passing.

Change-Id: I64d12c9509058d05f7adce94598cb7ce91727ac8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-05 10:27:58 +00:00
Alessandro Portale
15148d8e44 ProParser: Use the "Default Codec" when reading qmake files
This change adds a QTextCodec* member to QMakeVfs. It is used to decode
the qmake file contents in QMakeVfs::readFile. The QMakeProjectManager
sets it to the current "Default Codec".

This is necessary only in Qt Creator, where the parser would actually
use Local8Bit (unlike qmake's Latin1), which would sometimes lead to
misinterpreted multi-byte chars in comments swallowing newlines and thus
falsifying the actual code.

Bootstrapped qmake is not affected by this addition.

Task-number: QTCREATORBUG-17309
Change-Id: I34b42bd19e0de973deb2291e91f306d1ca7c630e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-01 17:06:41 +00:00
Tobias Hunger
16bb89fee9 Qmake: Remove useless nullptr check
Change-Id: I6fe9ca620d6bac9e3cab44fb90623fa984229416
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-30 13:39:21 +00:00
Tobias Hunger
6e17882bfc ProjectExplorer: Use Utils::FileName in ProjectImporter API
Change-Id: I60e05f1bd892b508db90bc48837e29e2725bf333
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-16 13:36:29 +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
67e011ba5f ProjectExplorer: Make naming of methods on Nodes more consistent
Change-Id: I5050a020f0fc0ef4556db1d2020afeadfcd51585
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:02 +00:00
Tobias Hunger
0f1f595a12 QmakeProjectManager: Improve signalling of parser state
Correctly signal when parsing of a qmake project starts and stops via
the build- and runconfigurations.

The buildconfigurations are in the picture since they disable the run buttons
when the user has selected to build before deploy and deploy before run.

Task-number: QTCREATORBUG-16172
Task-number: QTCREATORBUG-15583
Change-Id: I44b5f5ce8e145cb93dc0022f66e1edcc202875e4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 10:15:05 +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
Oswald Buddenhagen
5f17c280ec de-duplicate INSTALLS resolution
don't resolve the source files once for deployment and once for the
project tree.

Change-Id: Ifddf8fc7883bf025d3640de0d6676b5930991088
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:37:17 +00:00
Oswald Buddenhagen
7e86b98836 unify {,obj}c++{source,header} handling in qmake project manager
consistently with Xcode, qmake nowadays knows only one SOURCES list,
which is automatically classified by extension.
to replicate that, we actually copy the objective_c.prf file from qt
5.6.3 and use it to override whatever comes with qt, so we can treat all
qt versions uniformly.

also, the code model throws away the information which files were listed
as sources and which as headers. this is technically incorrect, as a
source may be only included rather than compiled, but there is no point
in extracting information which is not used.

conclusion: lump all c-like sources into one variable as far as project
processing is concerned.

and as far as configuration goes, our code model doesn't differentiate
anyway, so the duplicated setup paths can be eliminated as well.

Change-Id: I24b1bc056f8d9eb579c9378817f602912ab49971
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:59 +00:00
Oswald Buddenhagen
a8010b0fff make VFS aware of exact vs. cumulative evaluation
the cumulative evaluation has a good chance to make a mess of the
virtual file contents created by the exact parsing, so better contain it
to its own namespace.

the ProFile cache also needs to keep the files separate. this
specifically addresses the side issue discussed in QTCREATORBUG-10779.
it also fixes attempts to deploy the wrong build when the variant is
selected through a cache file, as in QTCREATORBUG-15815.

in the project explorer, we don't track from which evaluation pass
particular files came from, so we try the cumulative first to get the
most contents, and fall back to the exact one if the former file is
empty (or does not exist at all).

Task-number: QTCREATORBUG-15815
Change-Id: I2c1eb16c97526fa275a1c6a2eae9266d385859ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:22 +00:00
Oswald Buddenhagen
424639ecac make resource file handling able to deal with QMakeProject's VFS
resources.prf may create virtual qrc files when RESOURCES contains
non-qrc files.

Change-Id: If591de9b32b775059d67e94bc3cb06d23ee44b08
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:34:55 +00:00
Oswald Buddenhagen
1589ce3ce8 chuck sysroot handling out of ProFileEvaluator
qmake doesn't do anything with sysroots at this level, so this code
plain does not belong here.

sysrootification is used when resolving INCLUDEPATH, which is emulating
compiler behavior. this is done by higher-level code.

Task-number: QTCREATORBUG-11944
Change-Id: Ia25f0b6ef713e9809d974e3f3e49ba308b8c933f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:34:29 +00: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
Oswald Buddenhagen
ed7d13b6fc remove dead variable from QmakeProject::updateCppCodeModel()
allFiles was never read.

Change-Id: I96aa00ec43db342a572a41f1662ad3d76979f3b4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:11:59 +00:00
Eike Ziller
5b47c653c1 Merge remote-tracking branch 'origin/4.1' into 4.2
Change-Id: Ibe4cd5522e1d87d56d2aae7a429282b41bf18647
2016-10-12 16:02:47 +02:00
Risto Avila
8579e684df Fix behavior with no_plugin_name_prefix in CONFIG
If both plugin and no_plugin_name_prefix are defined in CONFIG, QtCreator
would not assemble the file name correctly.

Change-Id: Iebfc0402ff7c89f2a964cfcee77dfc77a6e5b0db
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-06 15:05:16 +00:00
hjk
33c732c60c ProjectWindow: Fix crash in TargetSetupPage
Move ownership of the ProjectImporter to the Project.

Task-number: QTCREATORBUG-16744
Change-Id: I7fc217ce8058287c5435b259bdc5300a926f8098
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-05 16:14:42 +00:00
Tobias Hunger
8f73b24e87 Qmake: Warn when project uses unexpected compiler(s) to build
Change-Id: I28b45b2f994ce2dd030f5dae2ab78ecb0b547b1f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-26 12:29:19 +00:00
Jake Petroules
f41b48ef5d Rename Abi::MacOS/GenericMacFlavor to DarwinOS/GenericDarwinFlavor
This makes clear that the ABI encompasses all Darwin platforms (macOS,
iOS, tvOS, watchOS) in the wake of the OS X to macOS rename, and would
have been more technically correct anyways since ABIs are far below the
"macOS" parts of our favorite desktop Unix operating system.

Change-Id: I16d1477f44ffe70e5d8cddd67199a1602ba6fd97
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-22 12:54:06 +00:00
hjk
2459652234 ProjectExplorer: Rework mode main window
The existing solution with the special-style horizontal
kit selector comes from a time when there was typically
one, at most four targets. Today's setup can easily
reach half a dozen targets with several toolchain versions
each and can't be sensibly handled with the overflowing
horizontal bar.

This here replaces the horizontal kit selector bar as
well as the top level project "tab bar" with a normal
tree view. All targets are visible (but possibly disabled)
at once, and can be enabled/disabled using the context
menu on the tree items.

Change-Id: I1ce7401ca96109bf34bc8c0ae19d265e5845aa88
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-07-26 10:00:09 +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
Eike Ziller
1ae483fc83 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/libs/utils/tcpportsgatherer.h

Change-Id: I495f3e05789f09efb8b1e84827893423a5b5b60c
2016-04-05 14:11:47 +02:00
Tobias Hunger
9944992345 QmakeProject: Fix crash when deleting while pro-files are being read
Change-Id: I94c069cb806285fa23fc1a702caf620be8413e0b
Task-number: QTCREATORBUG-15954
Task-number: QTCREATORBUG-15993
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-04 12:52:48 +00:00
Tobias Hunger
a01a0a4fed QmakeProject: Modernize a bit
Change-Id: I58ba382f5bccc1ce16f55cbd35eb84edf628d62d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-04 12:52:22 +00:00