Commit Graph

26 Commits

Author SHA1 Message Date
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
hjk
bcaeb73e68 ProjectExplorer: Store parts of active build config in runcontrol
... on runcontrol creation to prevent later access. Adapt some users.
There are more to come.

Change-Id: I2a3fe5eea0ada4eff7d08b79a6f49694e6962c8a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-09-24 11:20:51 +00:00
hjk
758986ea0e ProjectExplorer: Store some aspect data by value in the RunControl
Change-Id: Idb7e119b5b0b483ce91efeb21fb415b654cfed4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-05 13:45:25 +00:00
hjk
4028a41d2e ProjectExplorer: Use std::function for SimpleTargetRunner::start()
This spares us the typical r = runnable(); modify(r); setRunnable(r)
roundtrip and the m_runnable storage that might or might not
be the same as runControl->runnable. Similar for m_device.

Change-Id: I8300260dd8dd7cd395e40bcd3d2ae45089085008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-04 11:08:34 +00:00
hjk
2e8f650044 ProjectExplorer: Store BuildTargetInfo in RunControl directly
Target might go away...

Change-Id: Icbe040b030148a75e84f89b1ea47867f7ab18519
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-28 11:49:56 +00:00
hjk
19580ab203 ProjectExplorer: Less use of stored RunConfiguration in RunControl
Change-Id: I501433dcbc3d40c6439f5ab003e06f5a72b9d83e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-27 10:44:49 +00:00
hjk
3844f59806 ProjectExplorer: Standardize RunWorker creation logic
This unifies the remaining paths of RunWorker creation to always
use RunWorkerFactories in the plugin pimpls.

There were, and are, still effectively three basic kinds of workers:
 - "toplevel" tools corresponding to the run modes, that are often all
    that's used for local runs and directly started via the fat buttons
    or e.g. entries in the analyze menu, with factories already previously
    located in the plugin pimpls
 -  core "tool helpers", providing tool specific functionality typically
    used in conjunction with a remote device specific run mechanism,
    set up via RunControl::registerWorkerCreator
 -  target/device specific runhelper like port gatherers contructed e.g.
    via *Device::workerCreator(Core::Id id)

Worse, these categories are partially overlapping, so it was not
clear how a "clean" setup would look like, instead some ad-hoc cobbling
"to make it work" happened.

In some cases, the runMode id was used throughout the whole ensemble
of run workers for a given run, and which worker exactly was created
depended on which of the mechanism above was used in which order.

With the new central setup, the top-level runmodes remain, but the
second kind gets new ids, so the implicit dependencies on order
of setup mechanism are avoided.

This also helps in the cases where there was previously unclarity of where
and how to set up worker factories: It's always and only the plugin
pimpl now.

Change-Id: Icd9a08e2d53e19abe8b21fe546f469fae353a69f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-27 07:54:45 +00:00
hjk
ff277923d9 ProjectExplorer: Add a facility to dump supported run worker setups
Essentially walking the RunModes x RunConfigs x Devices cubes.

Information is just the factory pointer, or null, some name would be
nicer, but for now it turned out to be sufficient.

Change-Id: Ifdf92b2353cb5c0346ee4566beb7d78a00645aed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-20 10:56:06 +00:00
hjk
fcffb5f2fc Utils/all: Create an OutputFormatterFactory
Essentially following the scheme used for the various project
configurations. This makes it possible to construct OutputFormatters
by Id only, potentially reducing hard plugin dependencies and
opening the road to have several output formatters per
RunConfiguration/Outputpane/...

Change-Id: I4b5fb6fb6be8b0d9a0859f178bb0effc3398b09e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-13 13:07:06 +00:00
hjk
86e9c42c90 Project: Push direct RunConfiguration use out of RunWorker factories
Change-Id: Ie5a5771bcaed7085494d5875b42668ee8d6dc157
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-13 12:34:46 +00:00
hjk
f9c221eb54 ProjectExplorer: Re-work setup runworker factories
This combines two of the previous three paths to create run workers,
and refers to RunConfigurations by id, not by type where possible
to decrease coupling between the classes.

Only allow "type of run configuration" and "type of device"
as the only possible kind of restriction and require a uniform
RunWorker constructor signature.

Adapt user code to fit that pattern.

Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-09 12:34:42 +00:00
Christian Kandeler
5edb390bac ProjectExplorer: Fix qbs build
Amends 399f8d2dff.

Change-Id: I1e2fc0c70843ce85d99e85f51d48dbde6b7165ae
Reviewed-by: hjk <hjk@qt.io>
2019-08-07 11:52:46 +00:00
hjk
a79957038a ProjectExplorer: Replace RunControl::buildTargetInfo
... by two accessors to the only used field. General idea here
is to make the presence of a RunConfiguration in a RunControl
less prominent to be able to remove it at some time completely,
as the configuration's data might change while the control is
running.

Change-Id: I752540fadd135d6904fc9bf4e3506be074b0c003
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-07 11:51:04 +00:00
hjk
399f8d2dff WebAssembly: Drop run config inheritance from CustomExecutable
Also, auto-detect free port.

Change-Id: I377956ef20a928f1877d702162792e7cae75a202
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-08-07 10:53:21 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
611e1ea837 Utils: Encourage marking of raw command line parameters
Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-06 12:22:47 +00:00
hjk
d1fef0ea51 ProjectExplorer: Add a Runnable::setCommandLine()
Change-Id: I9b6a782e143dca8519cdc57171557bd3893df921
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-03 11:31:53 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +00:00
hjk
c3d0d2d97b ProjectExplorer: Make it easier to use RunConfiguration ids
... in RunWorkerFactory. The semantics is the same as in the other
{RunConfiguration,BuildConfiguration,...}Factory::addSupportedFoo
cases: As long as none is specified, there's no constraint, if
there are any, it's a whitelist.

Change-Id: Ia05afd9afe6886e4bacc58ac786f2548f03e5ca8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-05 05:32:43 +00:00
Christian Stenger
aa69f1af3d ProjectExplorer: Fix compile for journald support
Change-Id: Ib00057da9f8572f8d218af4f482d7dab60aa1f4e
Reviewed-by: hjk <hjk@qt.io>
2019-03-21 08:51:53 +00:00
hjk
592417ac17 Android: Avoid a direct use of RunControl::runConfiguration()
Change-Id: I69a610befeda78b85a2cb6285ff60a4e75ff12b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-21 08:00:31 +00:00
hjk
5672e1199a ProjectExplorer: Remove RunWorker::runMode()
Only used once, and that use can be replaced.

Change-Id: I844254dfff9bb2b2c9c56ecbd56d2af2241fd2d8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-21 06:47:50 +00:00
hjk
68a10d71e7 ProjectExplorer: Replace RunControl::producer
... by two more specialized canRun() / createMainWorker() functions
resulting in somewhat leaner code on the user side and paving the
way for introducing a RunWorkerFactory class intended to follow the
now-canonical way of having factories as members in the plugin pimpl.

Change-Id: Id6fc2043a340203f14ab0b896a8dfa1e298f58a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-20 09:16:08 +00:00
hjk
7a4752bde5 Debugger: Avoid some uses of RunControl::runConfiguration()
Change-Id: I1dcf5b96e6c23e369217f38a440305abb51dcd25
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-14 08:16:57 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00