Commit Graph

120 Commits

Author SHA1 Message Date
Tobias Hunger
39cddf5d03 DebuggerAspect: Simplify handling of Qml debugging
There should not be a need to have the linkQmlDebuggingLibrary Q_PROPERTY
anymore. The property is added for the benefit of the DebuggerAspect, which
can just check relevant BuildConfigurationAspect directly.

Change-Id: Ic47ca9e26911e096564fe77bd14bebe959b4f116
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 12:58:40 +00:00
hjk
278e981422 Qmake: Deactivate parse guard before it can cause trouble
... in the QmakeBuildSystem destructor

Change-Id: I23336cc0b72673fd2c63235b1c568439159d3d8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 16:45:04 +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
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
1eaf44a270 ProjectExplorer: De-QObject-ify BuildConfigurationFactories
The QObject was not heavily used. Object name was for debugging only,
translation context can be taken from the corresponding BuildConfiguration
objects, the qobject_casts in the three big importers are replaced by
dynamic_cast, which is good enough in that context.

Take the opportunity to re-use translations from base BuildConfiguration
for the common cases and sprinkle in some 'final'.

Change-Id: I8e9727c98c6e943cb333556861c24e701c2bdf45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-10 12:46:38 +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
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
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
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
hjk
c802a1b12a Qmake: Set QmakeBuildConfig aspect values more directly
Change-Id: I759371e4f71cd4270f1bf82152ceb2f851c3c06b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-05 16:54:19 +00:00
hjk
85b7833a3e Qmake: Simplify collection of available builds
No need for temporary list.

Change-Id: I77c2bace2c4b4eea95b36f8a075e07850ca8a4f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-05 16:16:01 +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
hjk
24f7c2b8fa Qmake: Accept global build settings as authorative
... when initializing build configuration.

Potential re-alignment with contents of pre-existing Makefiles
is confusing at best, and depends on the presence of Makefiles
that are typically close to invisble when using an IDE.

Change-Id: Iadbab4f32badfbf948cfa2a1b256932acbfe858f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-05 13:39:45 +00:00
hjk
d3b2c01c11 Utils: Move FileUtils::resolvePath to FilePath
In line with the general move toward use of FilePath nowadays.

Change-Id: I1c50e1479f7d9100ff8ded3ce3c22dd82b7fe6aa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-05 08:38:03 +00:00
hjk
1d32219eca Qmake: Simplify use of helper for creation of shadow dir paths
Change-Id: Iabe22a53f51e3475854e47af9e7f7efae6e16d1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-05 08:15:19 +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
e70116bf67 QmakeBuildConfiguration: Make use of Qt-related build aspects
Change-Id: Ia14bb468fe75403839d8dcc8022c4f233c363f62
Reviewed-by: hjk <hjk@qt.io>
2019-11-28 16:33:20 +00:00
Christian Kandeler
8a2fb30378 QmakeBuildConfiguration: Make use of SeparateDebugInfoAspect
Change-Id: I0dceadf2a6ef34187fa4107f3fc5d6831ecb7bfe
Reviewed-by: hjk <hjk@qt.io>
2019-11-28 14:48:36 +00:00
Christian Kandeler
221d356210 Qmake: Make proper use of BuildDirectoryAspect
Change-Id: I439496c85f7e0f402ab038de6a8171dd2f7d2ffd
Reviewed-by: hjk <hjk@qt.io>
2019-11-28 12:30:52 +00:00
hjk
5bac811432 Qmake: Move some non-configuration code from build config to build system
Change-Id: I6fdf20e740c2824cabb3659f36379f9325ab97bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-25 14:44:43 +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
Tobias Hunger
b489bfd615 BaseQtVersion: remove qmakeProperty(...) getter
Qt 6 will not use qmake to identify a Qt version, so this can not
be part of the public interface of BaseQtVersion anymore.

Provide getters for the information actually read via qmakeProperty(...).

Use the getters whenever possible.

Change-Id: Iadbee80b75e4f8b06caf90e7ed69fae2029b4dd7
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 11:46:43 +00:00
hjk
b9d88d3966 QmakePM: Remove unused explicit shadow build flag
Looks like the information has been based derived from
 buildDirectory() != target()->project()->projectDirectory()
for a while.

Change-Id: Ieb64e72d8fd1d4a6a339b695422fff6355cd3969
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-23 09:23:43 +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
hjk
8493a6b044 QmakeProject: Move QmakeBC::isShadowBuild
... to the config widget implementation, which is the only user.

Change-Id: I7cc70b6219dacedf1ef431a1fe21345b9ad69e7b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-29 11:36:05 +00:00
hjk
165f2f8938 Qmake: Replace QmakeBC::emitQmakeBuildConfigurationChanged
... by direct emission of the signal. Signals are public nowadays, so
the indirection is not needed anymore.

Change-Id: I82328a8fa05458e0478a52157863b7265f0a42ad
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-29 11:32:09 +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
hjk
f878486fcb Use build step ids for construction in more cases
Change-Id: If2deb7c02c082e29cc6b1f0408c0d0e06d1c584b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-26 15:00:30 +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
93dfbad97b QmakeProject: Use QString mkspec in QmakeKitInformation
... and BaseQtVersion, and QmakeBuildConfiguration.

Change-Id: Iac5f768b80a7f8c2ea9a37d099b285d5793270db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 11:16:57 +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
Alessandro Portale
e3586d164b QmakeProjectManager: Fix warning about build/source directory levels
While configuring a project, a wrong warning "Warning: The build
directory should be at the same level as the source directory." was
shown in some cases.

The reason was the innocent assumption that "projectPath" was just the
directory part of the project root. It was in fact the full "file path"
of the .pro file.

Change-Id: Icc5df51423b4bb05098d9d42cd328af949f85005
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-10 15:08:56 +00:00
Christian Kandeler
9686c85a46 Qmake: Improve the build dir location warning
The infamous "build dir is not at the same level at source dir" warning
for qmake projects has gone through a number of iterations in Qt
Creator, having been added, removed and re-added, always to the
criticism of some users. Our new approach is as follows:
    - The warning appears at the widgets where the build directory is
set, both in the target setup page and the build config widget.
    - The warning also appears in the issues pane, but only if the build
failed.
    - The user can disable the warning altogether in a newly introduced
qmake settings page.
    - This option is disabled by default on Unix, because to my
knowledge all failure reports have been for Windows hosts.
This should finally please everybody.

Fixes: QTCREATORBUG-16945
Change-Id: I638be1f15e8c260a5d72047d6850a3a0f685cf03
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-03-06 08:34:36 +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
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
d52af48883 QmakeAndroidSupport: Remove plugin
The remaining dependency is hacked into QmakeProjectManager
by using a compile time-only dependency on androidconstants.h.

Change-Id: Id78125137bc75c145a072bc753276abbf0029647
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-01-16 11:00:45 +00:00
hjk
54efabd6e9 Qmake: Move some data accessors from QmakeProFile to QmakeProFileNode
These are not used during parsing but when operating on the items
in the project tree.

This loosens the ties between the qmake related parser and project
nodes.

Change-Id: I077356fcde240df56b466c71c902c821c4885f6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-14 10:04:25 +00:00
Tobias Hunger
a43331ba67 Move "builddirectory" template from Core to ProjectExplorer
Move Core::DocumentManager::buildDirectory to
ProjectExplorerPlugin::buildDirectoryTemplate.

Move the setter along.

Change-Id: I3f1739723e800d04d2934149369b8881208305b4
Reviewed-by: hjk <hjk@qt.io>
2018-10-10 08:31:16 +00:00
Alessandro Portale
cd5066d86b QmakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-13 09:25:21 +00:00
hjk
18b2865834 ProjectExplorer: Add a BuildConfiguration::regenerateBuildFiles
That's effectively a generic hook for "re-run qmake" without the
qmake/QmakeProjectManager dependency.

Change-Id: I236d40690cde9047831422b2651ed2284b220959
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-10 09:57:55 +00:00
Eike Ziller
3bbe535b95 Merge remote-tracking branch 'origin/4.7'
Change-Id: I3c5d7e9e8c589ad4425cd89d61e1f572f5cb7997
2018-06-19 10:03:28 +02:00
Orgad Shaneh
77941ef9b3 Qmake: Fix redundant qmake execution for sub-project build
When building a sub-project using the context menu -> Build, qmake was
executed every time, because the pro file in the Makefile was compared
against the root project instead of the sub-project.

Change-Id: Id76d7d23e3fa9a8e4c5c10cd10adcc945ff3b186
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-13 10:11:30 +00:00
Eike Ziller
9b43b55dc0 Merge remote-tracking branch 'origin/4.7'
Change-Id: I762dbddb0f337e9a5fc4b113c7876813e9f45c9c
2018-06-11 16:01:18 +02:00
Orgad Shaneh
21c9740089 Qmake: Expand user arguments when comparing them to the Makefile
If the user used a macro, the Makefile will never match it, and qmake will
be executed on each build.

Change-Id: I2790db3a788ea7971145b475781a6193a1ed0842
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-08 09:21:23 +00:00