Commit Graph

166 Commits

Author SHA1 Message Date
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
hjk
cb55af8e55 Utils: Replace BaseAspect::setVisibleDynamic by setVisible
This was a workaround from a time where BaseAspect didn't know about
subwidgets created by derived aspects. That's not the case anymore.
Subwidgets registered with registerSubWidget() get their visibility
adjusted by BaseAspect::setVisibility() nowadays.

Subwidgets not registered with registerSubWidget() should not exist.

Change-Id: I8cdf72e5ea1f93c519f606913e084c78afecb56f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-09 11:30:10 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Christian Kandeler
3e2cb9d3d2 QbsProjectManager: Remove unneeded export macro
Change-Id: I4876ddce7dc350359aa554289f6806bbe4467145
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-19 13:29:18 +00:00
Christian Stenger
dd76bd8203 QbsPM: Fix wrong dll linkage on Win
Amends 9b8be3b3d5.

Change-Id: Icce629f06cb4130981ebb2801d3ef2032c80dbb5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-19 05:40:02 +00:00
Raphaël Cotty
9b8be3b3d5 QbsProjectManager: Add selection of abis for the android target
If the target is android and the qt version has more than one abi
then display a widget to select them in the build configuration.

Change-Id: I9d3ab60a0a1f4aba2e1250c495fa25917b254287
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-18 13:43:35 +00:00
Christian Kandeler
29ddb3bcdb ProjectExplorer: Allow to schedule a build/run during a project parse
Once we parsed the project initially, subsequent parses typically do not
change things in a major way, so we can expect e.g. run configurations to
stay intact.
It therefore makes sense to allow users to schedule an
application run not only during a build (see 4b92b7ac60), but also
during a parse. Arguably, this is even more relevant, as parsing is
usually not triggered directly by the user, but happens as a side effect
of editing a document or switching a branch. It is then annoying for
users to have to wait until the respective buttons get enabled again.

Fixes: QTCREATORBUG-24986
Change-Id: I1081ccde668eee794c39b96cd0bad5c3aaa580bc
Reviewed-by: hjk <hjk@qt.io>
2020-12-11 15:17:05 +00:00
hjk
d7b19b929d Qbs: Use a StringAspect for the "Equivalent command line"
Change-Id: I8d8c6039282dcdb870202e6d0d42d017f557b26a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-16 12:12:59 +00:00
hjk
2ecfda056b QbsProjectManager: Use a SelectionAspect to switch Debug and Release
Change-Id: I4beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-10 09:36:52 +00:00
hjk
56eb7628c3 Qbs: Continue aspectification of QbsBuildStep
This changeset only goes half-way, by introducing and using
aspects for the easy cases (five bools and the job count int).

Change-Id: Idb3a050f8bdd0c2c4eaf1c1d1cb4d71a5343321e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-09 09:21:31 +00:00
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
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
c0b001737c ProjectExplorer: Remove BuildStepConfigWidget::m_step
It's not needed centrally anymore.

Keep it in the only remaining user, QbsBuildStepConfigWidget. Also
there it will not be needed after aspectification anymore.

Change-Id: Ia29e1e1f5226832ecb62ca79675ce717c9e5ef9a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 15:53:30 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
Christian Stenger
0de1668802 Fix qmake build of unittests
This basically continues / amends work done
with e1c88116b3.

Change-Id: Ia8b3a4694e7fea4c15e344839f87c11fbe8fbbf4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-27 04:28:52 +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
Eike Ziller
602d690bab Merge remote-tracking branch 'origin/4.12'
Change-Id: Ie35e9959693b6f6f78509eea5b259d6493ef87f2
2020-04-17 08:09:55 +02:00
Christian Kandeler
6c32656a21 QbsProjectManager: Fix crash when unloading a building project
Note that unloading a building project is generally broken in that the
build manager waits indefinitely for the build step's finished() signal,
but that's a general problem which needs to get addressed in a different
patch. This one fixes a qbs-specific crash.

Fixes: QTCREATORBUG-23851
Change-Id: I93e254acd1c73fe7495d01fcad04ea9301130dd0
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-14 15:15:27 +00:00
hjk
79b680e7f0 Utils: Rename PathChooser::{f,setF}ileName() to {f,setF}ilePath()
It's returning a FilePath, so it's a better fit.

Keep the old versions as inline function now to ease downstream migration.

Change-Id: I535887928018f42b92895c8b0c82527f0d55e5ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-04-09 17:30:23 +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
Christian Kandeler
b22bb5a9a7 QbsProjectManager: Remove the QbsParser class
It serves no purpose.

Change-Id: I92e700ed5c1d2b72398f4c7b88dab0cea9404e4d
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 11:38:15 +00:00
Christian Kandeler
b15d1951a2 ProjectExplorer: Let IOutputParser handle newlines
This makes IOutputParser structurally more similar to
Utils::OutputFormatter, which makes it simpler to explore possibilities
of somehow uniting these two related classes.

Task-number: QTCREATORBUG-22665
Change-Id: Ibb12ab6c8c785d863b9a921102a929864d0a5251
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 08:13:58 +00:00
Christian Kandeler
cddaecfe21 ProjectExplorer: Clean up IOutputParser interface
- Remove unneeded/unused functions.
- De-virtualize where possible.

In particular, after untangling a number of self-referential
redirections, it became apparent that the outputAdded()
infrastructure was entirely unused.

Change-Id: I51e1beed008df2727b42494b087efa476342397e
Reviewed-by: hjk <hjk@qt.io>
2020-04-03 10:57:06 +00:00
Eike Ziller
61dc14b67f Merge remote-tracking branch 'origin/4.12'
Change-Id: I3e7049da2c3da6f784e3cb3407c22ada556e5d24
2020-02-26 08:35:05 +01:00
Christian Kandeler
65e244b238 Qbs: Use more sensible build step summaries
It makes no sense to use the "equivalent command line" value as the step
summary. It's much too long and will never fit into that label.

Change-Id: I55f291c370c97481d37e9f9ba9baec48d7215774
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 15:35:22 +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
1f5a089f24 Qbs: Pass related info directly to command line creation function
Saves a few casts and otherwise unneeded accessors.

Change-Id: I7a6ff1e8348a24690f35e69d300463a6c5c18867
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-14 15:48:38 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +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
hjk
ce434ccb5d ProjectExplorer: Use full class for TriState value
Allows more compact code on the user side in most cases and
can hide the internal 'int-ness' from user code by wrapping
Variant conversions in the TriState class itself.

Change-Id: I4c91e0cd798ee988a0b9cb057749251a4efebaff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-03 12:08:52 +00:00
Christian Kandeler
572af85224 QtSupport: Introduce QtQuickCompilerAspect
... and use it in the qbs build configuration

Change-Id: I53ef4fb8c267e2b4e033c01604bc5b7770b57777
Reviewed-by: hjk <hjk@qt.io>
2019-11-25 15:54:38 +00:00
Christian Kandeler
e63444b45d ProjectExplorer: Introduce SeparateDebugInfoAspect
... and use it in the qbs build configuration.

Change-Id: Ie9002e5c43d1d43c81dc30a1fcbb29a5a1a25705
Reviewed-by: hjk <hjk@qt.io>
2019-11-25 14:36:17 +00:00
Christian Kandeler
6c66af5c23 ProjectExplorer: Add a base class for build aspects
... and make use of it in the QmlDebuggingAspect.
A build setting is conceptually not a boolean, but a tri-state, as we
need to support force-switching a feature on and off as well as
specifying that it is to be left at its default value.

Change-Id: I15552614c5cf4f5187c026909d233c13e3487e81
Reviewed-by: hjk <hjk@qt.io>
2019-11-25 13:25:02 +00:00
Christian Kandeler
72ca179633 QtSupport: Add a QmlDebuggingAspect
... and make use of it in the qbs build configuration.
We cannot use it for qmake yet, because the build config there still has
a custom, non-aspectified widget.

Change-Id: Iacf902a2d9384d0074b10fdc98e082fa906fb6d6
Reviewed-by: hjk <hjk@qt.io>
2019-11-25 09:46:41 +00:00
Christian Kandeler
142d4ddb28 QbsProjectManager: Let users provide a default install root
Fixes: QTCREATORBUG-12983
Change-Id: I016d298aaf8abc0d96267115225ab825bdd039e9
Reviewed-by: hjk <hjk@qt.io>
2019-11-22 11:34:19 +00:00
Christian Kandeler
6913947986 QbsProjectManager: Switch to an out-of-process approach
That is, do not link to the qbscore library anymore. Instead, use the
JSON-based API.
Advantages:
    - We can build Qt Creator with qbs support without qbs being present
      on the build machine.
    - Smaller memory footprint for Qt Creator, as the qbs build graphs
      are now being managed by a separate process.
    - Potential crashes in qbs will not kill the Qt Creator process.

Fixes: QTCREATORBUG-20622
Task-number: QTCREATORBUG-22904
Change-Id: If7d344b0ac65a99ff0a3a3db215d61b8d903e47e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-21 13:32:18 +00:00
hjk
c9fe463fee Qbs: Remove unused QbsBuildStep::qbsProject
Change-Id: Ifd47683d1e61e5126d873a38172904692953e367
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:39:21 +00:00
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
01e482f96c Qbs: Use base project() in build step when possible
Change-Id: I8e6a1c9b06273ac77a3c7aa832d5ed4e63e5d475
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-29 11:26:51 +00:00
hjk
00bdb007ee Qbs: Simplify builddir change handling
Change-Id: Ie2eff91d58df007b53a86b353423e4183b845a80
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-26 10:39:51 +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
725ed099b7 Qbs: Inline qbsbuildstepwidget.ui
In preparation of aspectification.

Change-Id: I9461045db9f997d7ce74cf0c99e0a9159a682e1c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 13:38:42 +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
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
hjk
dd304fc824 Utils: Remove FileName::isNull
... and its uses in order to shrink the FileName interface.

Change-Id: I4b9a229d98ad53c4f189e381c89241981ddbed2e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-13 11:12:09 +00:00
hjk
f6312282f7 Qbs: Remove QbsBuildConfiguration::emitBuildTypeChanged
The base BuildConfiguration::buildType() is accessible, and does
not need the casts.

Change-Id: I74bf9636901b99e3bf24a1a2ec8f46aabe707fbb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-03 13:51:03 +00:00
hjk
78d1e2d772 Qbs: Move build step connection setup to build step constructor
Instead of doing it manually afterwards on both paths that create
them.

Change-Id: I0e1734ae2b5028ce1d471aea0272df52acead221
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-02 08:15:23 +00:00