Commit Graph

3443 Commits

Author SHA1 Message Date
hjk
397de4ff30 Tie SimpleTargetRunner desktop usages to individual RunConfigurations
This avoids the "catch all" that leads to conflicts with more specific
setups like the AppManagerRunConfig, and consequently lets us remove
the priorities in the RunWorkerFactories.

Change-Id: I382f00ca7f759eef995ac6fe749bb371ab027020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-31 10:17:23 +00:00
hjk
f44e73b858 ProjectExplorer: Simplify BuildStepFactory
De-QObject-ify class, tr contexts are now the product's
context, which was the case in some BuildStepFactories already,
and is current state in {Run,DeployConfiguration}Factory.
One spurious object name removed.

De-virtualize canHandle(), it was never overloaded and is not
intended to be overloaded anymore.

Remove unused clone() function.

Change-Id: Iff7fba5f707505f868f94458084a18650535fa23
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-31 10:15:42 +00:00
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
Eike Ziller
6e66b2a078 Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.

Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-28 13:45:20 +00:00
Tobias Hunger
88b065db3f CMake: Do not crash when deleting cmake tools
Do not crash when the cmake tool that was used to parse the project
gets removed.

Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-28 12:36:33 +00:00
Tobias Hunger
56e2fb2a95 CMake: Use std::make_unique
Change-Id: I01904f532976b908956c08b895d35f4d5a573bf8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-24 11:39:58 +00:00
José Tomás Tocino
caf935b60f CMake: Fix cmake version detection
Task-number: QTCREATORBUG-19966
Change-Id: I0834e1c117e96d05912b7bba7362b4d3d4c6c28d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-05-23 14:14:49 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Tobias Hunger
fdccc54275 server-mode: Always try to read CMakeCache, even after error
Change-Id: Ib3d4fb5ac14340a7f706e4a1d8a0cbdc420d01d1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-22 15:21:54 +00:00
Eike Ziller
58bd043e27 Centralize retrieving the "parent" build configuration
If a step is part of a build configuration, that is used, but many steps
can be used as part of a deploy configuration.
In that case the active build configuration of the step's target must be
used, and that logic was duplicated many times.
Instead, let BuildStep::buildConfiguration take care of that logic. For
steps that are not offered for deploy configurations there is no
semantic difference, and for the others this removes code duplication.

Change-Id: I02f3bb50226590092cedcec02fce6fde9c7c6e63
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-22 12:18:36 +00:00
Tobias Hunger
10005e35b9 CMake: Report an error when project can not get parsed
Report an error when a project can not get parsed.

Change-Id: I659a5ffb465b4a2de39910b05e7eef2481b9ad70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-05-18 09:11:30 +00:00
Tobias Hunger
1bffb72417 ServerModeReader: Fix crash when filtering out known headers
Task-number: QTCREATORBUG-20412
Change-Id: I9e58b099ef002b3139576b15507f191e1c5a5ced
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-18 08:26:16 +00:00
hjk
ce20bde99c ProjectExplorer: Pass id directly to BuildConfigurations
It's what the base class wants, and follows run and deploy precedence.

Change-Id: I26eff43337851702417e7e4284fc390b904060f6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-08 08:13:00 +00:00
Tobias Hunger
887d1f17a1 CMake: Do not sort nodes
The project tree will sort the nodes as needed, so there is no
need to sort the list beforehand.

Change-Id: I1ee71100aba003117c918c5295224ec1253dc807
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:03:30 +00:00
Tobias Hunger
2df36926f5 CMake: Use FolderNode::addNestedNodes for unique_ptr in server-mode
Remove FolderNode::addNestedNodes that take raw pointers now that the
last user is gone.

Change-Id: If2ca3864934d9239ac136e65c0b7dbcea7caf220
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:03:15 +00:00
Tobias Hunger
bdd2dd371e ProjectExplorer: Add FolderNode::addNestedNodes taking unique_ptrs
Use that in CMake's tealeafreader.

Change-Id: Id1c372b083df380d0d930668cf7eec4ee89060c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:02:56 +00:00
Tobias Hunger
6fbf0255eb ProjectExplorer: Remove FolderNode::addNode taking a raw pointer
Change-Id: I53b765d2c3e71889386c76425662bfcc47bdf582
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:29 +00:00
Tobias Hunger
d332954567 ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptr
Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:15 +00:00
Christian Stenger
8f6a560ed7 CmakePM: Fix compile for gcc4.9
Change-Id: Iecd2dc6df45199de049b02f24b1d1961b296ee2d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-02 13:28:51 +00:00
Tobias Hunger
147e6078ad ProjectExplorer: Make FolderNodeFactory return an unique_ptr
Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:47 +00:00
Tobias Hunger
5754d5accf ProjectExplorer: Use unique_ptr for Project::setRootProjectNode
Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:35 +00:00
Tobias Hunger
1f55ba9012 ProjectExplorer: Use unique_ptr to hold ProjectNodes
Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:29 +00:00
hjk
4ec4f111cb CMake: Do not store the "title" in the run configuration
This has been superseded by other items, most notably the buildKey.

Incidentally, even Creator 4.6 is robust enough to handle .user files
without the CMakeProjectManager.CMakeRunConfiguation.Title key without
problem.

Change-Id: Iaecb2c15b31ebfb78146c0bec8b955ae821e4499
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-26 12:52:54 +00:00
hjk
366be94ad9 Pass id to RunConfiguration constructor
It's what the base class requires, and opens the possibility to
have several factories creating the same type of run configuration.

Also move ios, winrt and android factories closer to their products,
it's the predominant pattern nowadays.

Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-25 15:06:11 +00:00
hjk
d269e9a492 ProjectExplorer: Factor out some common code in runconfigurations
DesktopQmake, CMake, Qbs, Nim, RemoteLinux and Qnx now have a common
understanding what should be in a runnable and how their
configuration widget should be set up. So move them over to
using shared code, too.

Several others runconfigs only lack a one or two more aspects
to follow suit in later patches.

Change-Id: Ia862c95c97d63bd0a0f2dc303435775a2fc530d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-24 05:58:48 +00:00
Eike Ziller
d1ec4c1204 Clean up options page category display name and icon set up
In cases where plugins extend an existing settings category of a plugin
that they depend on anyhow, they do not need to specify the translated
display name and icon for that category.
Some options pages were already not setting the icon, but still the
translated name, which makes even less sense.
Clean up this mess, only setting display name and icon if that is
necessary.

Change-Id: I8bc9d0c51b11d48f1d847337838704d663e70b45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-23 11:12:26 +00:00
Tobias Hunger
460fdc02e0 ProjectExplorer: Report project-specific kit errors/warnings
Report project-specific warnings about the kit used in Project Mode.
E.g. a python project should not complain about missing toolchains,
while a qmake project should.

Change-Id: I5ce6742683cdeffc7ff3f1a3e8f0b89aee9aa0b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:45 +00:00
hjk
83c6a4916c ProjectExplorer: Streamline OutputFormatter creation a bit
Note that the concept of a single monolithic OutputFormatter per
RunConfiguration (and why RunConfiguration, not RunControl to start
with?) is unchanged and suboptimal as one cannot easily combine
existing use cases, e.g. Python_and_Qt.

Change-Id: Ibeb8191020387324f22ed313230293597f96e36a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 11:55:31 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
Eike Ziller
ab7960f6cf Move Project::makeUnique to Utils
This is more generic than projects

Change-Id: Ifdbc57ff48f9fd4a40e6149ba636e0a55cbac502
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-11 06:42:27 +00:00
hjk
a06514c365 ProjectExplorer: Start unifing visual appearance of run config widgets
Margins and layout style widely differ so far. Start moving everything
to a QFormLayout with the same margin and growth policy.

Change-Id: I0bd1d8b2ec9830be56354be1376a2a24eebb8845
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-10 08:41:16 +00:00
hjk
0df9d6dda9 ProjectExplorer: De-qobject-ify RunConfigurationFactory
Some translations moved over to the corresponding RunConfigurations,
one setParent() replaced by direct deletion.

Change-Id: Ib5e527b71353a6be70b332ac2dfd2f5cd2499a60
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-09 10:57:36 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Nikita Baryshnikov
a16d712c11 CMakeSpecificSettingsPage: delete SettingsWidget
Also added Q_OBJECT macro, for tr call in ctor.

Change-Id: I4766b6299a07e3ba0ebc8577e9f4471021b89f07
Reviewed-by: hjk <hjk@qt.io>
2018-04-06 13:31:51 +00:00
hjk
8c713d45a8 CMake: Use new ExecutableAspect
Change-Id: Ic880351802c52b61c53c6730d23dfe3f124ebc44
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-29 14:27:14 +00:00
Tobias Hunger
cebc354484 CMake: Remove icon from QRC file
Change-Id: Idf0187858b7617d52f8d91b2b2d6febe1ea93bca
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 11:00:41 +00:00
Tobias Hunger
38ed8495dd CMake: Move CMake project settings page into Build & Run
Change-Id: I51d482aa0187e4fc501d6c82f506c9874ffc6551
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-23 10:40:28 +00:00
Tobias Hunger
63f31a1e4b CMake: Make cmake build step available to all build step lists
"cmake --build ." is useful to build, clean and deploy, so offer it
everywhere.

This fixes soft asserts as a side effect when loading cmake projects with
existing "cmake --build . --target=clean" in their clean steps.

Change-Id: I39e5866f6012b9ea1153da324e4abd1cd25fea92
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:18 +00:00
Tobias Hunger
9f21358cbe CMake: Remove code that is obsolete since QtC 3.7
Saved data has changed in QtCreator 3.7, remove compatibility code.

Change-Id: I27e1f163f905b5f8fd105f3cdeaf047777a1c06c
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:12 +00:00
David Schulz
07870754b6 fix qbs build
broken by 190c5083b7

Change-Id: I28b509c91e3cc4e80c4dde1748bc92415929a46d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-22 14:09:54 +00:00
hjk
798d115a5c Consolidate some run configuration widget boilerplate
This removes the outermost layer of widget-vbox and moves some
common code into a helper function.

The pattern repeats (with variations) a few more times, that's
left for later patches.

Change-Id: I8c98229cf41d03d5330c896ec9fa0965bfc65602
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-22 09:44:49 +00:00
Ivan Donchevskii
08d1274ccc CppTools: Remove processEvents call from follow symbol
processEvents is a bad way of dealing with asynchronous
requests. Use QFutureWatcher for that purpose.

Change-Id: I3839cb9db80a6d391f6af1178e96986a325b7b99
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-19 13:37:46 +00:00
hjk
cd1534a646 CMake: Some cosmetics to move closer to default style
Change-Id: If2c36eda6157e5dd78abf4f25029ecfd153e228a
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 12:32:47 +00:00
hjk
300b953ba4 CMake: Compile fix
Change-Id: I3f9d07490ab98ec1f5e0d0acd9def2d02010ea12
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 12:27:18 +00:00
Pawel Rutka
190c5083b7 Add Specific settings page to CMakePLugin and create checkable dialog box for user after add new file action
Change-Id: If5702764fa81f2fdda3ef59780b217e47643b030
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 10:49:45 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01:00
hjk
9f81129417 CMake: Restrict CMakeRunConfigurationFactory to local setups
Anything remote is being taken care of by the target specific factories,
having CMakeRunConfigurationFactory accept everything too leads to
unhelpful duplicated entries.

Change-Id: I7e509593f6eaed8ee75ef0acef1703a877b1f011
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-14 09:38:14 +00:00
hjk
a5d6fe33cb Partially decouple local CMakeRunConfiguration from CMakeProject
Funnel all relevant data through target.applicationTargets() as
done for the non-local CMake-supporting setups and QBS already.

There is cleanup potential left for later changes.

Change-Id: I49ed6abd98c058a7fd1545e41b3bcd6ecb758a8b
Task-number: QTCREATORBUG-19985
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-13 15:02:54 +00:00
hjk
eece1be316 CMake: Re-add RunConfiguration display name
Amends 6f04ca646 for QTCREATORBUG-19762?

Task-number: QTCREATORBUG-19954
Change-Id: I5da8bf15b5b62500fd0936d15451dfefd878b57b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-13 12:12:03 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00