Commit Graph

138 Commits

Author SHA1 Message Date
hjk
8e7138f06a Android: Use Util::FilePath for working directory in deploy step
Change-Id: I37e716f267cbcc39bc0bddc8b37e84613e048721
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-06-05 09:58:33 +00:00
Anton Danielsson
a154f26af5 Fix AndroidDeployQtStep
Bug was introduced by Utils::CommandLine.
Cased "executable" to be an empty string.

Change-Id: I2b5cd31e3eb1d2d18252dac90de07c053de9f3ce
Reviewed-by: hjk <hjk@qt.io>
2019-06-03 12:13:52 +00:00
hjk
a7345b67c1 ProjectExplorer/Android: Some more use of Utils::CommandLine
And surrounding cosmetics.

Change-Id: Iad3d2d43856b1fcd9530d4a209fff9887e6cec42
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 16:49:47 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +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
eb9e3c807c Even more FileName::appendPath() -> pathAppended()
Change-Id: I0a8bc391ff3704e14df87e4fa3bc82269146f943
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-20 13:13:06 +00:00
BogDan Vatra
57c48630a8 Android: Add proper QBS support
Now we can use QtCreator to build, deploy, run & debug QBS projects.

[ChangeLog][Android][QBS] Add Android support for QBS projects.

Fixes: QTCREATORBUG-15573
Fixes: QTCREATORBUG-19880
Fixes: QTCREATORBUG-22182
Change-Id: I08b153a44dcf7ca178689c1c30fa2201c4cc0dbb
Reviewed-by: hjk <hjk@qt.io>
2019-04-26 06:37:00 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
Eike Ziller
a1973090da Fix lupdate issues
Change-Id: I0db9094a8161aa8f854ca4fafa16d8bc79a67868
Reviewed-by: hjk <hjk@qt.io>
2019-03-12 16:29:59 +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
fd5916ae23 Android: Simplify deploy step widget setup
Remove the nested QGroupBox, inline code into only callers, etc.
Also use better display name for deploy step widget.

Change-Id: I579810c04dea032a98ba28db6de035048f801f75
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-01-28 10:16:17 +00:00
hjk
90e31668d6 Android: Code cosmetics
Remove unused functions, inline rarely-used code, ...

Change-Id: Ib3b0645cebf6bfabea1f4f2b4c5a582afca18101
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-01-22 15:14:58 +00:00
hjk
372fbf9c05 Use new DeployConfigurationFactory::addInitialStep in some cases
Less code, less classes.

Change-Id: I3ba9920f4f389e14c67cd8c5d937a4b4659865e7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-21 12:05:28 +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
hjk
a1ae5820af Android: Make device info caching hack a bit less intrusive
The list of earlier build steps is not used anywhere else,
so it's not a really useful generic feature to have.

Avoid its single use here by searching for the interesting
step directly.

Change-Id: I52fffc75008dc01ff8ec6ca16045cbf151087ec1
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-01-15 13:18:02 +00:00
hjk
5d1114fe52 ProjectExplorer: Drop the target argument
... from ProjectNode::targetData and setTargetData, and rename them
to data and setData.

It was only used in the implementation to retrieve the right node,
instead move the responsibility to find the right node to the caller.

Current assumption is that the functions were always called on
the right node already.

Change-Id: I9ae7e8a7ed5c79b924b99fd9a6a652bad56d114a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-20 16:18:37 +00:00
hjk
93257a56a0 QmakeAndroid: Replace remaining AndroidQtSupport
This uses the same approach as in the previous patches: Have some
generic interface in the base classes (here ProjectNode::targetData()
setTargetData()) and implement on the qmake project side.

Implementation for Cmake/QBS is architecture-wise possible, but
not used right now, and left for later.

Change-Id: I3bbf66170020cf9027a894cd66db15ec7ffbf499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-20 13:13:51 +00:00
Robert Loehning
82e997cf59 Android: Capitalize properly
Change-Id: Ie5f35592db6c83feff63df519cc15a47eabc8d9c
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-26 13:45:53 +00:00
hjk
bc5e640a46 ProjectExplorer: Use a data member for BuildStep::runInGuiThread
Change-Id: Ia219fcf595c05c6f1b82f420454bd906c6870ee7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-10-23 15:38:43 +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
Eike Ziller
511bd64f3f Merge remote-tracking branch 'origin/4.8'
Change-Id: I0ff6f659b7ccd4ff5a79e422a1d54488508fe05f
2018-10-16 07:11:57 +02:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Vikas Pachdha
ca69b8a8a8 Android: Re-install Qt live on version mismatch
Use version code to determine the app's version, version
name is only for display

Change-Id: I8e3a8f6b1b8fab2014a762ebabf09b3ce2e0b559
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-10-08 08:54:36 +00:00
hjk
3ba3f74051 Android: Use QVariant for targetData/setTargetData
This makes it more similar to the classic QAbstractItemModel::{data/setData}
pattern and hides qmake-specific semantic (variables are QString*Lists*)
behind something more general.

Change-Id: I82d7006affd4af208be2b7640076698d13fd3a61
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-08-01 10:47:31 +00:00
hjk
d8326afcff Android: Simplify apkPath determination
It doesn't explicitly need the qtSupport indirection anymore.

Change-Id: I25f0649a3b7760fdef3b62097ac55341e6b16fe4
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-08-01 10:47:02 +00:00
Alessandro Portale
be5c228e5b Android: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: I6c9e567edf16cf436c0e0c1239b40f74574a1096
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-07-26 08:26:21 +00:00
Vikas Pachdha
b8da47af9c Android: Log Qt live apk path and few more code paths
Change-Id: Id743db4865b399c619c04fc393540758352c60e1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-07-19 14:47:58 +00:00
Vikas Pachdha
f10002e3f5 Android: Deploy Qt live apk for QML projects
Task-number: QDS-16
Change-Id: Iafb1f7ea5d354e73020ff3c5175efa82f99bdffe
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-10 11:51:44 +00:00
Vikas Pachdha
aa4407e332 Android: add logging for build and run
Change-Id: Idca5a45713762aa9e2861dcc58c3bbd96cbe687e
Reviewed-by: hjk <hjk@qt.io>
2018-07-04 07:04:03 +00:00
hjk
1058e21d02 Android: Merge {Qmake,}AndroidSupport::androiddeployqtPath
... into its only user, in the build-system agnostic base.

Change-Id: I1fe312125a32e3150e4f3183470df716896e55c4
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-06-22 12:47:08 +00:00
hjk
2093781f3a Android: Remove code to help with upgrades from Qt 5.1
Change-Id: Id9cf0cd585ebdaabc03ff58ab04e7c12a5af39ba
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-06-13 12:06:37 +00:00
hjk
b774dff4e8 QmakeAndroid: Move some build-system agnostic items to Android base
Change-Id: I0f258ee5e4afcb3abc7c2bbbaa612b1912a8d2b9
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-06-13 11:23:59 +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
Vikas Pachdha
ee8b4f3512 Android: Do not deploy when missing build config
Fixes deployment on Android

Change-Id: Ie32407afc2151d7fdae62f69b4a1eecd1618da30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-09 10:49:56 +00:00
Vikas Pachdha
fea16708b7 Android: Do not start AVD when AVD name is empty
Task-number: QTCREATORBUG-20350
Change-Id: I36b5c81b05b34c3caa515b32b504c4441b2a1f2b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-03 06:17:17 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
Vikas Pachdha
9a946decc3 Android: Give preference to detected deploy errors
Task-number: QTCREATORBUG-17414
Change-Id: I35171dc8649c9ecd790a1a508ccc3d4f690ee67b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 05:02:46 +00:00
BogDan Vatra
429c596395 Android: Fix debugging on Android 8+
The new way is much reliable and now we can debug all the libs from very
first start, including static constructors, JNI_OnLoad, etc.

The downside is that the startup is a little bit slower then before.
On a Ryzen 1700X is 2 to 5 seconds slower.

Task-number: QTCREATORBUG-19081
Change-Id: Iacedf7b8aa84de5026f9c81eeca35dd377cf4640
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 14:05:40 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Vikas Pachdha
e6898fd863 Android: Fix app_process not being copied for 32bit cpu abi
Task-number: QTCREATORBUG-20084
Change-Id: Id06cfb6250030851211c7c170f8d0c8b0491b3d8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-04-09 05:54:23 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01:00
Vikas Pachdha
1fae424f83 Android: Pull linker from device/emulator
Task-number: QTCREATORBUG-19931
Change-Id: If8f0b5fe767f9e816ac5163142d4fa38e0f6540f
Reviewed-by: hjk <hjk@qt.io>
2018-03-13 11:40:52 +00:00
Ulf Hermann
b088972a9c Android: Tolerate empty build/deploy configurations
If there is no build or deploy configuration, just skip the building and
deploying.

Change-Id: I8b6f6d14100f366df5683eb77490d7c0dc588f94
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 12:30:49 +00:00
Robert Loehning
e4b07d6f74 Android: Fix typo
Change-Id: I5f732957d893ab94cd7486658019407137069891
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-01-05 17:53:29 +00:00
Robert Loehning
517b35c9d7 Android: Initialize members
Change-Id: Iba2ec7c99d4083edf92601a8a7f2e5074f30cd7b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-01-05 16:48:34 +00:00
hjk
36f720907c Android: Use device types as restrictions on project configurations
Change-Id: I3f7ff05f27c76dadec9a9ff0ae02848830655472
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-12-19 10:52:28 +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
Jake Petroules
845271e957 Android: turn "use Ministro" into a checkbox
Ministro is an advanced deployment option which requires knowledge of
how to set up and maintain a Ministro repository. Place it with the
other advanced options instead of as a checkbox alongside the normal
deployent mechanism which is used by default and probably in the vast
majority of cases, in order to reduce cognitive load on the user and
clean up the UI a bit (since two options in a radio selection doesn't
make much sense).

Task-number: QTBUG-62995
Change-Id: If33b3c73db4fcc66717dd4ff0f7923f0250e8418
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-10 14:41:12 +00:00