Commit Graph

197 Commits

Author SHA1 Message Date
hjk
a68aee95a1 ProjectExplorer: Replace ProjectConfiguration::m_macroExpander
... by MacroExpanders in Build and RunConfiguration. Deploy didn't
use its own, BuildStep always composed an empty expander with
the BuildConfiguration's, uses now the BuildConfiguration's expander
directly.

Change-Id: I9de51bfc32aeb3d73f4974175e42a37807e49ac1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 09:31:02 +00:00
hjk
b4ee6eb3c0 ProjectExplorer: Move some of the BuildInfo setup code to central places
Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 13:56:10 +00:00
hjk
a971da3bfe ProjectExplorer: Replace BuildConfigurationFactory::availableBuilds
... by a function object.

Change-Id: I9953ba6915c0177e7c4067d36dd755fc2ba5cf84
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-09 15:42:21 +00:00
hjk
14d64b4a5f ProjectExplorer: De-noise buildconfiguration.cpp
Change-Id: I82084b950f8256a5c17dcf20dc3373921c17ee02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-08 09:47:43 +00:00
hjk
571fb04d59 ProjectExplorer: Register some initial build steps by id
Helps to cut down BuildConfigration::setInitializer() usage.
Plan is to have more of that where feasible.

Change-Id: I138fcffc743daaf7068b5236c2a19c9ca0e3e2d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-07 11:51:13 +00:00
Christian Kandeler
5cebf2a79a ProjectExplorer: Move some build-related code to BuildManager
The projectexplorer.cpp file is a huge mixed bag, which could use some
cleaning up. The queue() function is very much related to the
BuildManager, so move it there.

Change-Id: Ibc6425cc27d44514803a5e7c6139f83ddd760382
Reviewed-by: hjk <hjk@qt.io>
2019-12-19 17:35:46 +00:00
Christian Kandeler
6e0d44b0ff ProjectExplorer: Let users provide project-specific environment
Add a new project panel where users can set environment variables for
the current project in all configurations.

Fixes: QTCREATORBUG-21862
Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44
Reviewed-by: hjk <hjk@qt.io>
2019-12-12 16:34:22 +00:00
hjk
b1a29dedfc ProjectExplorer: Pass parameters to BuildConfiguration initialization
... directly again, mostly undoing the temporary hack from fb631cb258.

Change-Id: I4485dcb23765d99b4b5869973f004457ebd7aa7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-10 11:43:33 +00:00
hjk
041a86c8c7 ProjectExplorer: Use function object for special build config init
Change-Id: I5da0f28ee1a64f8d9a3145f059019be702bee463
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-09 14:12:45 +00:00
hjk
3c41b91d44 ProjectExplorer: Settle on fixed set of build step lists
Even if the implementation allowed different lists than 'build'
and 'clean', that's the only set that has been used, ever.

If really needed, this could be re-instated, but for now having
them fixed removes part of the neeed for a two-phase construction
and helps to simplify user code.

Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-06 14:49:59 +00:00
Christian Kandeler
4933f79111 ProjectExplorer: Provide the option to build only the app to be run
... instead of the entire project.
This can speed up the development cycle by ignoring irrelevant changes
in the project, potentially at the cost of missing parts that actually
should be re-built (in particular with build systems where a product
does not have full knowledge of its dependencies).
Supported by qmake and qbs for now.

Change-Id: Ic7101aa243e92ba139798d13366d256c1919dcc3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-12-05 14:18:06 +00:00
Christian Kandeler
dd7f4890a2 ProjectExplorer: Introduce BuildDirectoryAspect
Change-Id: Id57d0a7901d2cec7b2d4f1fbeed6a1ecb41642cc
Reviewed-by: hjk <hjk@qt.io>
2019-11-27 13:49:53 +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
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
Christian Kandeler
efa9832912 LayoutBuilder: Allow for more compact code at calling sites
Change-Id: I12bb6dbfc138e03138b9a74d36e864d8ea36092f
Reviewed-by: hjk <hjk@qt.io>
2019-11-07 11:53:37 +00:00
hjk
6908ecc084 ProjectExlorer: Streamline creation of NamedWidgets
Change-Id: I67c1506ea4e2d7722c9ce38738e350418d725a0e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-01 10:20:32 +00:00
hjk
b00e82c3e8 ProjectExplorer: Pimpl BuildConfiguration
It's quite fat already and will own the BuildSystem later.

Change-Id: I5b9edd27fbd485b4e2b74cd9c57084d2874089bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-22 08:01:33 +00:00
hjk
6eaf239777 ProjectExplorer: Prepare more flexibility to aspect layouting
This hides the explicit use of a QFormLayout from the aspect
interface in a new LayoutBuilder class. That currently works
only on a QFormLayout in the back, but opens the possibility
to use e.g. a QGridLayout as use on the Kits and some option
pages.

The aspects now only announce sub-widgets they like to add,
actuall positioning is does by a new LayoutBuilder class,
also cramming several widgets in an hbox in the right column
of the QFormLayout is done there.

Change-Id: I2b788192c465f2ab82261849d34e514697c5a491
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-18 12:24:39 +00:00
Sona Kurazyan
8e31932c29 Remove usages of deprecated APIs of QLayout
Replaced:
  QLayout::setMargin() -> QLayout::setContentsMargins()
  QLayout::margin() -> QLayout::getContentsMargins()

Task-number: QTBUG-76491
Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-02 13:01:07 +00:00
hjk
f4c1c0e441 ProjectExplorer: Rename BaseStringAspect::{f,setF}ileName
... to filePath and setFilePath. In line with Utils::FilePath.

Change-Id: I7115b91876542629c3d61c8259bbd8d9f4022fc1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 05:42:37 +00:00
hjk
fb631cb258 ProjectExplorer: Set up hack to funnel information to buildstep ctors
For now, store most of BuildInfo in the BuildConfiguration. This will
allow accessing it in the BuildStep ctors so the BuildSteps can
be fully setup without polishing afterwards (as currently done
in the main build steps of the three buildsystems, and Nim)

This in meant to be temporary to a large degree.

Change-Id: If6ade6052f4b96670995399ae97ef7d2313f632a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-22 11:05:04 +00:00
Tobias Hunger
988d376ad0 ProjectExplorer: Handle parsingStarted/Finished in BuildConfiguration
Make all buildconfigurations disabled while the project parses.

This unifies how this is handled in different build systems.

Change-Id: I6afca3743ad1433529a4f9d3bfdf73042799e456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-21 08:32:22 +00:00
Christian Kandeler
6d3f236aab Utils::Environment: Use expanded values
The Environment class is supposed to support values with references to
other variables, but we failed to actually expand them in most places.

Fixes: QTCREATORBUG-22687
Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05
Reviewed-by: hjk <hjk@qt.io>
2019-08-20 12:39:16 +00:00
hjk
ca67d3016c ProjectExplorer: Use direct calls to signal update wishes
Change-Id: I73d4a417f23bcf7fd8c9e16640e920100a6cce5a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 11:32:44 +00:00
hjk
d16330de6d ProjectExplorer: Add a ProjectConfiguration::target()
... with a suitable default implementation accessing a member
populated at construction time instead of walking the parent
chains on each access.

Change-Id: I58dae6da80ed0b023cc603fca13a5a205b123672
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-29 12:06:19 +00:00
hjk
a6c85993ba ProjectExplorer: Propagate build environment changes more directly
To check this still works I used a CustomRunConfiguration with
a executable name $AAA, the tooltip there tries to expand that
(and complains that $AAA is not an executable).

By inserting a AAA=/bin/ls in the build environment, the tool tip
on the run config exectable path chooser changes appropriately,
same for changing the AAA value.

The connection seems also needed, dropping it destroys that updating.

Change-Id: I28965cbd3ce530a83d98808ca7624a6799cd9800
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-26 12:05:52 +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
5dbfd46bcf ProjectExplorer: Merge BuildConfigurationFactory::availableBuilds
... and availableSetups as far as mechanically possible.

Change-Id: Ia1d7babe943eea25da97cef7838187c234378673
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-27 14:19:53 +00:00
hjk
f94e55b807 ProjectExplorer: Align signatures of BuildConfiguration
... availableBuilds() and availableSetups().

Goal is to merge them and inline all the local createBuildInfo()
functions.

Change-Id: I9f19093163808b6da6dc83977894420e08a1edd9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-27 13:59:39 +00:00
hjk
e7c6169d70 ProjectExplorer etc: More FilePath usage
Mostly for project files.

Change-Id: Icb6059f80758865e42cc9f9c092ec6782770dfd7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-26 16:02:23 +00:00
Marco Bubke
4bae5de36b Enable macro editing for the Clang indexer
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.

Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-13 16:51:48 +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
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
Christian Kandeler
be9bd1505b ProjectExplorer: Trim value of build directory
... coming from the line edit. Nobody enters a build directory with
leading or trailing spaces on purpose.

Fixes: QTCREATORBUG-16805
Change-Id: Ic33f126fb9c4c0d008ebeaf00a78c737729be623
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 15:23:39 +00:00
hjk
44e97b3055 ProjectExplorer: Inline convenience overload that was used just once
Change-Id: I4b695a07b60df0d197f549657e0ce23ca4fe5ccb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-03 14:14:26 +00:00
hjk
02ab64f239 Nim: Aspectify NimBuildConfiguration
Change-Id: Iccf81e3a089a6b6d756aace99c5051dc7349b6b9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 09:06:30 +00:00
hjk
8e1e312273 QbsProjectManager: Aspectify QbsBuildConfiguration
Change-Id: Ifff6b770b9c6e2313809b35eef041c674df362e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 09:04:38 +00:00
hjk
a64b969f6f ProjectExplorer: Consolidate setup of build dir aspect
This is getting repetitive.

There's a new connect too, that's not wrong in the current two uses
and will be helpful in the upcoming Qbs one.

Change-Id: I4a4923a43937922c66be1f73822103b1e3e7b077
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-04-29 12:05:38 +00:00
hjk
3941f0593b AutoTools: Use the base BuildConfiguration config widget
Change-Id: I928b9bc7adc3424008ead27fe8457d345e1bcda5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-29 09:04:45 +00:00
hjk
34eb195358 ProjectExplorer: Use a BaseStringAspect for build config build dirs
Just for the "storage" part with this change.  Plan is to also
use the gui parts one-by-one in the BuildConfig reimplementations.

Change-Id: Ie5e4e701eea8d83336103654c708f4f1ab8132e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-26 15:28:20 +00:00
hjk
0a8546ab13 ProjectExplorer: Add a BuildConfig::createConfigWidget() implementation
Mimicking the other aspect-unsing setups. It is currently re-implemented
in all derived classes, i.e. unused.

Change-Id: Ia1c16318347baa13a869d3eb03717a0f5ff0d8f8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-26 15:26:48 +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
8bc7e04012 ProjectExplorer: Fix build directory expansion
QDir::cleanPath() must be called on the expanded path, otherwise it
messes with the data. For instance, QDir::cleanPath("%{a:b}/..") yields
".".

Change-Id: If55b9c7a733097cb36f62fbdae49fe03b542fcdf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-07 12:06:35 +00:00
hjk
a235d33837 ProjectExplorer: Remove BuildConfigurationFactory::priority
It's essentially an intrusive hack that's used only to prioritize
Ios+Qmake over plain Qmake. The effect is now achieved by an
arguably equally evil dependency on the construction order of
BuildConfiguration factories.

It can be argued, however, that this is a feature as it allows
user plugins to intentionally override core functionality by
using the standard setup pattern and depending on the to-be-
overridden plugin.

Change-Id: Ic1efa305daf3ca19a880d2a7ccb40e2768d8f57c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-31 14:33:05 +00:00
hjk
4ae0ad3ab5 ProjectExplorer: Use a addSupportedTargetDeviceType function
... also for BuildConfigurationFactory, similar to Run and Deploy.

Change-Id: I453f08bf145d6a2e764d150646c698d624ae2ce9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-31 14:32:54 +00:00
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
hjk
070e0efdcc ProjectExplorer: Rename IBuildConfigurationFactory
... to BuildConfigurationFactory. It hasn't been an Interface for a
while and the new name matches Run- and DeployConfigurationFactory

Change-Id: I923c6a27e18a99628251b69e0270e910836e7b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-29 11:38:31 +00:00
Tim Jenssen
a78e3e5dd5 use initializer lists
Change-Id: I82b04601f1db52197b3dc625b6b7e0f143c1c8b6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-21 15:10:54 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Tobias Hunger
e20075f8cf ProjectExplorer: Trigger environment evaluation on current project change
This makes e.g. %{CurrentProject:VcsTopLevelPath} in the kit's
environment much more useful.

Task-number: QTCREATORBUG-20752
Change-Id: I4bf49e61a7a7281a6c9bf039a1d9118b6e4060ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-13 11:06:28 +00:00