Commit Graph

71 Commits

Author SHA1 Message Date
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
Aaron Barany
d2e420bfe7 CMake: Don't change targets when parsing fails
When first loading a CMake project, if parsing fails all targets get reset
to the "all" target. Most commonly users will notice this when the "clean"
target gets reset to "all", and can often go unnoticed for a while. This
can become especially annoying when custom target configurations are used.
With this change the previous targets will be preserved upon failure.

Fixes: QTCREATORBUG-21617
Change-Id: I52a3a2c472c7b8d98bc016b1e55a202147fc091c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-25 18:48:18 +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
Alessandro Portale
17f169c291 CMakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using

Change-Id: I6a272bc3b75835840b3d6cbe83be6f50f94bbedb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-25 07:50:15 +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
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
98479ba312 Merge remote-tracking branch 'origin/4.7'
Change-Id: I00b0009867322be55c215351054acc7de5b9e335
2018-07-12 14:56:13 +02:00
Tobias Hunger
e6cfe06dfc CMake: Fix building on current executable target
Task-number: QTCREATORBUG-20763
Change-Id: Ie25c0993c1c2051de3f6a15fca56b56caaa04b00
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-12 09:57:20 +00:00
hjk
f44e73b858 ProjectExplorer: Simplify BuildStepFactory
De-QObject-ify class, tr contexts are now the product's
context, which was the case in some BuildStepFactories already,
and is current state in {Run,DeployConfiguration}Factory.
One spurious object name removed.

De-virtualize canHandle(), it was never overloaded and is not
intended to be overloaded anymore.

Remove unused clone() function.

Change-Id: Iff7fba5f707505f868f94458084a18650535fa23
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-31 10:15:42 +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
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
Tobias Hunger
63f31a1e4b CMake: Make cmake build step available to all build step lists
"cmake --build ." is useful to build, clean and deploy, so offer it
everywhere.

This fixes soft asserts as a side effect when loading cmake projects with
existing "cmake --build . --target=clean" in their clean steps.

Change-Id: I39e5866f6012b9ea1153da324e4abd1cd25fea92
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:18 +00:00
Tobias Hunger
9f21358cbe CMake: Remove code that is obsolete since QtC 3.7
Saved data has changed in QtCreator 3.7, remove compatibility code.

Change-Id: I27e1f163f905b5f8fd105f3cdeaf047777a1c06c
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:12 +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
Eike Ziller
7f626b1182 Merge remote-tracking branch 'origin/4.5'
Change-Id: Iceaa4ca40b5318744bde8a76c6d3ccca08df71bb
2017-10-25 16:07:21 +02:00
Leena Miettinen
f4cd9cdb6a CMake: Fix UI text
Change-Id: I3587084925089c7bb7ffb9cfb09f6b822b215cd8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-24 08:47:52 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02:00
Tobias Hunger
02533e61cf CMake: Fix project parsing notification
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.

Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-06 09:53:40 +00:00
Tobias Hunger
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00
Daniel Trevitz
b5379d599f cmake: Crash when removing
Fix nullpointer error. Occurs when no active project exists

Task-number: QTCREATORBUG-18865
Change-Id: I826daac39c38ae1382d23cae20da9085dbcfe298
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-08 09:28:57 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Tobias Hunger
f119eec4d1 Project: Get rid of builddirectoryChanged signal
Get rid of Project::buildDirectoryChanged signal as well as
Target::buildDirectoryChanged (and the infrastructure).

Change-Id: Ia749e62eec7e182e558d81115dc2a3d07b72b346
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:37 +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
46f39f5601 CMake: Simplify signaling
Change-Id: I50fdaed0d813b5004c1756e9c5a6efd3ce7a3318
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:47 +00:00
Tobias Hunger
b8e348c4af BuildStep: Do not use QLatin1String/QLatin1Char in BuildSteps
Change-Id: I287831a9151ba867eec443206235c7e07a6176e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:29:26 +00:00
Tobias Hunger
543929cd2c CMake: Warn when doing out-of-source builds with in-source configuration
Warn when attempting to do an out-of-source build while an in-source build
is configured. This seems to confuse cmake.

Task-number: QTCREATORBUG-18381
Change-Id: I1abd3be4129ba5af6439dcd60d16d429b93c0382
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-28 11:43:25 +00:00
Tobias Hunger
c0c210cbda CMake: Use tr in BuildStep
Its a QObject, no need for QCoreApplication::translate here.

Change-Id: I3375a70fe60b66e13de6b9a99c35c85f82b9151e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-28 11:43:08 +00:00
Claus Steuer
8542ebcd5d CMake: Do not react to builds in the background
If an error occurs while persisting or updating the cmake state, the
build might continue for a while in the background.

CMakeBuildStep does not disconnect the Error/Run-Trigger when an
error is signaled by the CMakeBuildConfiguration. Instead it reports the
build as finished (with error). The BuildManager then disconnects the
output and runs the next item in the build queue (if any). However the
cmake step might still be alive and emits the dataAvailable signal which
then triggers the build process.

Task-number: QTCREATORBUG-18382
Change-Id: I956133fe8c6f7de58b9f842b231c70d24778b1e0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-20 13:37:58 +00:00
Tobias Hunger
460e1d7e93 CMake: Add "test" target to cmake builds
Always show a test target for cmake projects. This will show even
if there are no tests in the project. But I think it is more annoying
*not* to be able to run tests via the locator when tests are available
than getting an error message when attempting that with a project that
does not have tests.

Task-number: QTCREATORBUG-18323
Change-Id: Iba85aa868cb9bfe6c3f44a7ffff620d081d3082f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-13 12:47:44 +00:00
Tobias Hunger
ccdf335425 CMake: Fix possible nullptr dereference
Change-Id: Iadb62b671e115b2348dbe1d927212fd79a7fdf33
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-03 11:53:01 +00:00
Christian Stenger
10c285db86 CMakePM: Fix compile using Qt5.6 and gcc4.9
Change-Id: I192a213a8825c636dc42702a32a065ad541bd2af
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-04-28 06:30:29 +00:00
Tobias Hunger
11c87bd918 CMake: Unify setup of default build target in CMakeBuildStep
Change-Id: I3d087356a4dd5a3b8ab07d5b64cd5aeb93ae0f47
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:16 +00:00
Tobias Hunger
10d6a3bc3d CMake: Fix signal emission from CMakeBuildStep
This fixes the summary in the UI.

Change-Id: I8eb93a1785d8788d9021e06b75a10cb36f119f0f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:10 +00:00
Tobias Hunger
d8d2dc6adb CMake: Report special utility targets in BuildDirManager::buildTargets
Report special utility targets like "all", "clean" and "install" from
the BuildDirManager and update UI accordingly.

Change-Id: I01d0dcfa23d5bddc124c8f9ee1040475184c9c1e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:01 +00:00
Tobias Hunger
e7b4e91fec CMake: Define an "install" target
Change-Id: I036ddc3bfb91fc3a5a9e8923db2befbf60e89a77
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:50:54 +00:00
Tobias Hunger
1e178915df AbstractProcessStep: Free output parser chain in error case
Change-Id: Ie0dc094068bfa56f728d84ee13e70efbc980f8b3
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:23:21 +00:00
Tobias Hunger
b5ab98dfd5 CMake: Simplify code
Use defined helper method instead of duplicating code.

Change-Id: I1eec61f99875ccd28e6e64bd5ad2bfd7e6e21eb3
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:22:33 +00:00
Tobias Hunger
79f5a27568 CMake: Use RCs buildSystemTarget when deciding what to build
Use the RCs buildSystemTarget property when deciding what to build
with the "build current executable only" property set. This makes
the selection more robust.

Change-Id: I0dbcd764a06428b441084e6e4dc680e106c6d3bd
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:22:17 +00:00
Tobias Hunger
a3be2c08ee CMake: Fix clean target
Always list a "all" and "clean" targets and remove the similar code
in the tealeaf reader.

This fixes the clean-step falling back to "all" in server-mode.

Task-number: QTCREATORBUG-17138
Change-Id: I1ce84f03c2e9829e4bb5f550c10cdef772fabf5b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-03 11:21:47 +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
Christian Kandeler
c05a3fdb3d Give the values of BuildStep::OutputFormat better names
The old ones did not convey their meaning very well. In particular,
NormalOutput and MessageOutput were easily confused.

Change-Id: Ia0a8c1b1c366ab3f5c59f751b37b8b1f68f6831d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-19 16:08:57 +00:00
Tobias Hunger
53d45de8a0 CMake: Allow to build target from context menu of CMakeTargetNodes
Change-Id: I0457abd6dabea1699272482eb5f7fbb3ca097310
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 09:30:59 +00:00
Tobias Hunger
b17c98ad6f CMake: Trigger cmake run *before* build when files changed
Make sure to run cmake *before* cmake --build when cmake files just
got saved. This helps e.g. when editing CMakeLists.txt files and the
hitting "Built" and "Save all" (or "Always save before build").

Task-number: QTCREATORBUG-16187
Change-Id: I16b1d02eb342a447003380946ce7a9d785476a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 08:47:02 +00:00
Tobias Hunger
4d7420fe49 CMake: Fix warning
Change-Id: Ibfa8e5a9df03c9249f0feb6a8133dc222d57743d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 08:36:26 +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
Eike Ziller
5097768552 Merge remote-tracking branch 'origin/4.0'
Change-Id: Ic82bea5abc6f9539044873b9872c70b3d66a642e
2016-04-25 16:23:15 +02:00