Commit Graph

71 Commits

Author SHA1 Message Date
hjk
97c6c13dcb ProjectExplorer: Remove BuildStepConfigWidget
After the previous changes it was only an empty wrapper around QWidget.

Change-Id: I58dcd82d8342c7de5e2df537044f6cf3de878a67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-06 08:06:39 +00:00
hjk
c3833406cc iOS: Remove unnecessary check in IosBuildStep::init()
A buildstep always belongs to a build configuration.

Change-Id: Ia24e571fbaf47c97797661774e87d583bddb1d76
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-05 10:22:58 +00:00
hjk
b97b7dc6f2 ProjectExplorer: Move BuildStepWidget::summary etc to BuildStep
The step is the source of information anyway, and available at the
only place of use. No need to copy that over to the widget, neither
for keeping it up-to-date there when the mechanism is already
available in the step itself.

This creates quite some potential for the simplification of
the various createConfigWidget implementations in follow-up patches.

Change-Id: I4474665f194a1ff7c5792ad086ed53c8d3ce13e6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-05 08:16:51 +00:00
hjk
591e93316d Consolidate build/deploystep default display name handling
Use the display name from the factory as default, override if needed.

Change-Id: I03519c998432fea4120b0de8b2fc2686644635f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 13:18:45 +00:00
hjk
0d185a0ad3 ProjectExplorer: Simplify use of AbstractProcessStep::init()
1. Systematically check for AbstractProcessStep::init() first in
   derived classes.
2. Use setupProcessParameters(processParameters()); by default in
   the base implementation.
3. Drop all re-implementations that are effectively the same.

Change-Id: I0ae54dd4909b354672a63ee56d0b7c2ea0732494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-16 16:16:13 +00:00
hjk
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
hjk
f450c369a3 iOS: Remove redundant IosBuildStep::m_clean
This was determined and fixed at step creation time. There is
also no way a step can morph its "cleanliness", so there's no
need to persist that either.

Change-Id: I4c49aaee2cf00b6d428a8e4a213f1f072a01f57b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-02 09:57:27 +00:00
hjk
912fd4a1b3 iOS: Inline IosBuildStepConfigWidget
Also clean #includes.

Change-Id: I105edb5f0505545a371db6944831a96b3e8db698
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-02 06:30:22 +00:00
hjk
0cfe11a960 Ios: Use new AbstractProcessStep convenience functions
Change-Id: I8a20690b679a4f2205295be48e4e5e99dee94d79
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-17 14:39:42 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Kandeler
1c6e4fbd32 Merge output formatters and output parsers
Now only one piece of code needs to be written to both linkify output in
an output pane and create tasks for it in the issues pane.
The calling sites are also simplified. For instance, until now, build
steps had to feed their output parsers manually and then push the
created tasks up the signal stack in parallel with the actual output,
which the build manager relied upon for cross-linking the output pane
content. Afterwards, the output would get forwarded to the formatter
(and parsed for ANSI escape codes a second time). In contrast, a build
step now just forwards the process output, and task parsing as well as
output formatting is done centrally further up the stack.
Concrete user-visible improvements so far:
    - File paths in compiler/linker messages are clickable links now.
    - QtTest applications now create clickable links also when run
      as part of a build step, not just in the app output pane.

Task-number: QTCREATORBUG-22665
Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-23 08:47:08 +00:00
Christian Kandeler
45ba9fcd53 Output parsers: Replace the chaining approach
Use "flat" aggregation instead.
This is another step towards the formatter/parser merger.
Along the way, also fix some some subclasses (mostly in BareMetal) that
erroneously forwarded handled output to other parsers.

Task-number: QTCREATORBUG-22665
Change-Id: I12947349ca663d2e6bbfc99efd069d69e2b54969
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 14:49:32 +00:00
Christian Kandeler
7745eacc7a Output parsers: Generalize the search directory concept
All parsers can now have search directories, not just the GnuMakeParser.
This allows us to get rid of the "task mangling", removing another
instance where the order of parsers in the chain mattered.

Task-number: QTCREATORBUG-22665
Change-Id: Id0d55522ae6800afd9f50ff36546224b0d8bb382
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 15:20:22 +00:00
hjk
16e87971cd iOS: De-Q_OBJECT-ify IosBuildStep
Change-Id: If6b32de1f359e6f18d86caa77dcd6ed311f3adbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-21 11:49:04 +00:00
hjk
1714ecf809 ProjectExplorer: Remove Task::buildConfigurationMissingTask()
It should not be possible to trigger the condition. Except for MakeStep
the function is only called from real BuildSteps, that always live in
a BuildConfiguration.

A MakeStep could live in a DeployConfiguration, but that belongs to
a Target. That target always has a BuildConfiguration in case the
project type requires one. So not having a BuildConfiguration can only
happen when the project type doesn't require one, but then the
situation is not an error that should be notified as a Task.

Change-Id: I2a5d90fdadd3916d3dae6a0fdc6e6ab2010a8111
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-21 11:11:18 +00:00
hjk
3fe1911d46 ProjectExplorer: Introduce some BuildStep convenience accessors
... and use in ProcessStep and related classes.

Change-Id: Ie6f1403d0aa2b9f5bcde06e994809466700b1357
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 16:11:05 +00:00
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
hjk
c95bde6f6a ProjectExplorer: Pass Id to BuildStep constructor
Allows to use constants in fewer places, similar to what e.g.
RunConfiguration does.

Change-Id: I9d049128206c4acf0ce14b06b66d6c090a7c5242
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-09 11:26:01 +00:00
Eike Ziller
34e8f58c47 Fix lupdate issues
Change-Id: Ib0cbb96a1a4857db5724f9d1e316b97bf2827dbd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-04 14:06:09 +00:00
hjk
65f2f8a2b4 Drop connections to active target and build config changes
... for build step related widgets. These are specifig to a build step
which in turn is only interested in its own build config and target.

Change-Id: I5ec277ba279932d18a615e528acffaccdc41e307
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-13 13:21:52 +00:00
hjk
16b9a47e83 ProjectExplorer: Replace Project::projectConfigurationChanged
... by a Project::buildConfigurationChanged. That's the only case
used, and saves filtering on the receiver side. Also, the passed
bc is (in non-null) the active one, so isActive checks are not
necessary.

The null case seems to be only possible to trigger when removing
the currently active build configuration manually i.e. happens rarely,
so having it trigger an unneeded final display update on the dying
build config is tolerable, so drop the null check in such cases
to achieve a more uniform pattern.

Change-Id: I46f72e9e277767214dbd6920dd86b026a7084f46
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 13:59:31 +00:00
hjk
dcb892cf39 Update build step widgets only on changes to the owning build config
Updating on changes to other build config seem excessive, as the
updated details only depend the owning build config.

Change-Id: Iba86f2b56033ac55381d452dd2a435e5dda72674
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 11:20:45 +00:00
hjk
7d3091a7b9 ProjectExplorer: Remove ProjectConfiguration base from Target
Targets are different from {Run,Build,Deployment}Configurations,
both regarding the level in the ProjectExplorer hierarchy, and
also by the set of supported operations (e.g. aspects).

Change-Id: Ia8490e2280a9ecc518395c5e48ce2fd5d6d58fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-31 11:18:16 +00:00
hjk
54c82c950c iOS: Inline IosBuildStepConfigWidget
In preparation of aspectification.

Change-Id: I0a97440aa6c4bc749af51219ccace519982bfaa1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-26 12:59:33 +00:00
hjk
3170601b4d ProjectExplorer: Prefer ProcessParameters::setCommandLine
... over setting command and args individually.

Change-Id: Iec7c8d3a0b05fb8fa0639f7ddbe7ccdc7387d2a2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-24 13:47:05 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
9433b8a7e7 ProjectExplorer: Use Utils::FileName in ProcessParameters
For the command and the working directory.

Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-15 12:55:22 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Christian Kandeler
966f4ea6a9 ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.

Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-31 16:10:01 +00:00
hjk
f007bc7593 ProjectExplorer: Simplify BuildStep::init() signature
The extra parameter was always computed but used only in one place,
and that use got removed lately.

Change-Id: Ie10c0107ca70ee97ce03f83294992aab8d1a3ffe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-18 09:11:37 +00:00
Orgad Shaneh
04ae0c8dfb ProjectExplorer: Pimpl AbstractProcessStep
Change-Id: I0f77ff2e88b29674c306b394093deb2060db70c8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-11-19 10:02:46 +00:00
Alessandro Portale
39400381b3 iOS: Modernize
modernize-*

Change-Id: I64d2bb4320c9b444bc13e90099600628eac1f5a6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-13 15:44:34 +00:00
hjk
0f5d5dbfe4 ProjectExplorer: Make BuildStep::immutable use a data member
Default to false, remove all no-op reimplementations.

And rename the getter to isImmutable according to the rules.

Change-Id: I8cce79d88fb59badfa1cffcf30a46f7ff3b09e8b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-10-23 14:12:39 +00:00
hjk
d6c605d84c ProjectExplorer: Change BuildStepConfigWidget::summaryWidget()
From a virtual function to a normal one backed by a real data member.

That's essentially what several re-implementations did, the other
ones used a fixed value instead.

Change-Id: I61e45f1d4f7f0f80fe2eb1f2729785f37e7bb803
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-10-17 06:14:55 +00:00
hjk
683e7aa6cf ProjectExplorer: Make BuildStepConfigWidget::displayName a value
Use BuildStep::displayName() as default.

This probably could be the only possibility, but currently there
are some discrepancies that are kept in this patch to make
the patch mechanical.

Change-Id: I2a1e5c2ff37ad95e25309eb16e07099e42191f60
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-10-15 12:08:22 +00:00
hjk
cbb98bedcf ProjectExplorer: Merge SimpleBuildStepWidget into BuildStepWidget
The extra m_step member is not worth the abstraction, especially
since almost all non-SimpleBuildStepWidget have something similar,
too. Also, as several derived classes needed to correct
SimpleBuildStepWidget's setShowWidget(false).

Change-Id: I6e80d8c84c363b90dc27c70abd7fa6cefa1ed91e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-10-12 16:01:46 +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
hjk
280b7e2109 Ios: Use device types as restrictions on project configurations
Change-Id: I3c31f14eba9d9f68a333a814bea800a3da38d4a2
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-12-19 09:16:45 +00:00
hjk
53a151074a ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.

- Collapse the two lines of constructors similar to what
  890c1906e6 did for RunConfigurations
  * Deploy* was purely mechanical
  * Build* ctors are split in connects() in the ctor body
    to create "empty shell for clone" etc
    and build step additions in initialize() functions which
    are only used in the create() case.
  -- Allows to collapse the shared 'ctor()' functions, too.

- Move FooBuildConfigurationFactory::create() implementations
  to FooBuildConfiguration() constructor. That was a strange
  and unneeded ping-pong between factories and objects, and
  furthermore allows one level less of indirection (and for a
  later, left out here, some reduction of the
  FooBuildConfiguration interfaces that were only used to
  accommodate the *Factory::create() functions.

- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
  but there wasn't one in the base classses. Have one there.

- Most canHandle() functions were checking simple restrictions on
  e.g. project or target types, specify those by setters in the
  constructors instead and check them in the base canHandle()

- clone() is generally replaced by a creation of a "shell object"
  and a fromMap(source->toMap()), implemented in the base, there
  are two cases left for Android and Qbs that needed(?) some extra
  polish

- generally use canHandle() in base implementation, instead
  of doing that in all Derived::canFoo()

- as a result, canCreate/create/canClone/clone reimplementations
  are not needed anymore, keep the base implementation for
  now (could be inlined into their only users later), but
  de-virtualize them.

- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
  'dsym' build step they could create.

- Split the 'mangled' id into the ProjectConfiguration subtype
  specific constant identifier, and a QString extraId() bit.
  Only maintain the mangled id in saved settings.

- Make ProjectConfiguration::m_id a constant member, adapt
  all constructors of derived classe.

Not done in this patch:

- Finish possible cosmetic changes on top

- Add a way to specify restrictions to supported Qt versions
  (used in Android/Ios), as the base implementation does not
  depend on the qtsupport plugin

- Combine the QList<X> availableFoo() + createFoo(X) function
  pairs to somthing like a direct
   QList<struct { X; std::function<X()>; }> fooCreators()
  to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
  pingpong

- Remove the *Factories from the global object pool

- Do something about priority(). Falling back to plain
  qmake in android+qmake setup is not helpful.

Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-08 11:17:55 +00:00
Tobias Hunger
43c04ac80b BuildSteps: Fix a number of crashes
Fix crashes due to activeProjectConfigurationChanged signal sending
a nullptr.

Uses the same fix as QTCREATORBUG-18865, but in more places:-)

Task-number: QTCREATORBUG-18866
Change-Id: Ic71af5ed26b2a44339f0c687f3f46bfdf62c2489
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-08 11:16:38 +00:00
Tobias Hunger
e52ebbf217 ProjectExplorer: Add subscribeSignal method to targets and projects
Add a subscribeSignal method to targets and projects that will make
sure all signals of all project configurations added during the lifetime
of the project/target will get connected (if the type matches).

Use this to connect to some signal in all BuildConfigurations of
a project and get rid of code that keeps connecting to the current
build configuration.

Use Project::buildEnvironmentChanged as an example and convert its
usages.

Change-Id: I689bcebac4b191bf3f8a18765bf18eaac371c5fe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:19:28 +00:00
Tobias Hunger
6979a8f2f5 IosBuildStep: Use member initialization
Change-Id: If64e3ca3c2457e88f2eba948eee6a7a9a127d346
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-07-23 11:51:20 +00:00
Christian Stenger
6621f5594f iOS: Fix compile with Qt5.6
Change-Id: I0ee2e97b94da72140631df01c6ddf59252e5138e
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-06-13 13:40:48 +00:00
Tobias Hunger
190f2d9e8d Mobile platforms: Do not use QLatin1String in BuildSteps
Change-Id: I3d67e94e7dc2d86ac1eba641562ee4a045f95d6c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-06-13 12:46:51 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +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
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
hjk
519cc8ded6 ProjectExplorer: De-duplicate code in IBuildStepFactory derived classes
This removes 900 lines of duplicated code, some duplicated checks at
runtime and some (minor) quadratic behavior when gathering display names.

canClone(), canRestore() and canCreate() and restore() use the same
pattern. Handle that on the core side once. Leave retore() virtual to let
the ios code unmodified (which is likely not needed, later...). Introduce
'Unclonable' and 'Uncreatable' flags to keep Android package installation
and WinRT deployment (non-)functionality unchanged.

Change-Id: I0325479aff818a4038b2f241ca733b8d8cd66f2f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-10 10:34:51 +00:00
Tobias Hunger
4fe46e492f Ios: Convert some classes to Qt5-style connects
Change-Id: Ifb483a92c75d9851f0c3f4c69f080ac449b35e40
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-25 07:40:02 +00:00
Jarek Kobus
3f19774c0f Set LC_MESSAGES instead of LC_ALL for parsing the error output
Task-number: QTCREATORBUG-15855
Change-Id: I05aa83acb356840cfdacc92796b190fb8754ada0
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-11 12:36:29 +00:00