Commit Graph

111 Commits

Author SHA1 Message Date
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
Vikas Pachdha
027383814a Android: Remove Ant and make gradle as the default java build tool
All GUI options to choose between  ant and gradle are removed.
Gradle is the only java build tool used now.

Change-Id: I309ff66256c5d40920a5d77a8331c5917c53c185
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-09-14 09:01:12 +00:00
Jake Petroules
6458473414 Android: remove support for local/debug deployment option
This is only usable with versions of Android older than 5. Now that
Android 8 is the current version, we say goodbye to this feature as it
is almost certainly no longer of use to anyone.

Task-number: QTBUG-62995
Change-Id: I19795eb385b18f4dd87a1bb8df57d36c3fa28dc5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-09-06 18:21:26 +00:00
Vikas Pachdha
70be880bcb Android: Use avdmanager tool
android tool is deprecated since sdk tools version 25.3.0.
Use the new avdmanager tool

Task-number: QTCREATORBUG-17814
Change-Id: Id6f495f14e12d0069df08164cac1929b76d9e932
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-12 13:42:10 +00:00
Eike Ziller
1704c484a8 Merge remote-tracking branch 'origin/4.2'
Change-Id: I9006dd493707ae626ae3502541599c8789e1aab0
2017-02-27 15:17:37 +01:00
Vikas Pachdha
0e814daa5e Android: Ask to uninstall the app on version downgrade
Deploy step succeeds with error INSTALL_FAILED_VERSION_DOWNGRADE

Task-number: QTCREATORBUG-17789
Change-Id: Ib1c3023cbea7df1802ce967f10b549db7208aa17
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-24 14:02:11 +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
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +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
Vikas Pachdha
7458d82a37 Fixes Permission model downgrade issue
Task-number: QTCREATORBUG-16630
Change-Id: I2ec8fbe186d9a78efa1457a5fbbbaf1fe4da80b5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-08-03 13:29:36 +00:00
Vikas Pachdha
5cdff92c58 Refactoring: Android Deployment failure error codes
Change-Id: I88165fcad770e8b8341b252e4fc32b437528647b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-08-03 13:26:40 +00:00
Tobias Hunger
cb14fb0d71 Kits: Save several ToolChains per kit
BREAKS BACKWARD COMPATIBILITY OF TOOLCHAIN SETTINGS!

* Convert old ToolChainKitInformation to new version
* Store several toolchains in one kit (one per language)

Change-Id: Ia59a2ad067c57971ec34ce9b2e43758344443755
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-14 15:34:06 +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
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.

Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-11 10:04:38 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
hjk
5f53b95636 Android: Avoid endless loop in the presence of crashed process
while (!proc.waitForFinished(200)) { ... } effectively behaves as
endless loop if proc is already crashed at that time.

Change-Id: Ia2228ceddc9c45a37816209deb7e4fd69c7ab7b9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-04-29 12:18:55 +00:00
Tobias Hunger
2e5102f45e BuildStep: Remove finished() signal and use FutureInterface to report
Remove the finished() signal that is (sometimes) used to report that
a buildstep is done and use the FutureInterface for that purpose
consistently.

Change-Id: Ibe5520b562b91f1a7f4fc73ee898b33b930029ec
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-25 11:23:42 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
8d936b8aa6 AndroidDeployQtStep: Keep data requested from user around
Reuse the data for the following AndroidDeployQtSteps that
are in the same batch submitted to the BuildManager.

This should fix Qt Creator asking for the device multiple times
when building projects that depend on other projects.

Task-number: QTCREATORBUG-15338
Change-Id: I4fbb04d4d8e492f6a766461bca3e6f9683824def
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-17 12:11:42 +00:00
Tobias Hunger
79f82d0d0a BuildManager: Provide context of earlier build steps to init
This information can be used to get information from earlier steps,
which e.g. queried for android devices to deploy to.

Change-Id: Iefe1c9443915cb6211f86f98ff7aaf3cb75145ba
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-16 14:04:59 +00:00
Daniel Teske
ac4b3f33d0 Android: Change pulling of app_process binary to not use readLink
As apparently Samsung devices don't have it. The new algorithm
is:
- If it is a 64 bit device
  - Either pull /system/bin/app_process64 (64bit process)
  - or pull /system/bin/app_process32 (32bit process)
- If it is a 32 bit device
  - First try /system/bin/app_process32
  - If that doesn't exist try /system/bin/app_process

The old code did a symlink resolution on one of app_process[32|64|],
but I believe the symlink resolution was only needed for a symlink
from app_process to app_process32, which is covered by this code.

Change-Id: Iedeeb247c3059931e1ddf6d01e8b2aab13156470
Task-number: QTCREATORBUG-15006
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-09-25 13:28:30 +00:00
Tobias Hunger
52a52ca09f Android: Remove unused constants
Clang warns about these.

Change-Id: I002d97356dd7b6401edc577b69978d5d17a1e404
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-08-31 12:16:17 +00:00
BogDan Vatra
d6520122a2 Android: Pull the right libc.so from device.
On an 64 bit Android, libc.so for 64 bit apps is located in /system/lib64/.

Change-Id: I93f0e4658e552c9a32822706bab3e503642a8c59
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-06-22 11:09:37 +00:00
Daniel Teske
8e2370638a Android M: Use readlink without -s
Apparently the readlink on android M no longer supports that
option.

Change-Id: I27d5539ad746daa82b928801391597e43ed96cca
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-06-12 12:42:32 +00:00
BogDan Vatra
a88636bd51 Make sure we pull the right app_process from device.
On arm64 devices /system/bin/app_process is a symlink to /system/bin/
app_process64, the problem is that we are pulling it also for 32bit
apps, which will make the debugging impossible because arm-linux-
androideabi-gdb 32bit can't mix the architectures.

Change-Id: I37e071456fb89051b0433ee2e7635085257616ea
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-05-26 09:29:45 +00:00
BogDan Vatra
50a47cdb49 Make sure we pull from the selected device.
Change-Id: Ifbf1987e1b4322f1a0878855a12c4966bd77dc71
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-18 09:47:08 +00:00
Daniel Teske
597096312f Android: Fix deployment to wrong avd
We used to only identify the avd by api level and abi. That was
obviously incorrect, but at the time I didn't know how to get
the actual avd name from a running emulator.

Turns out this is reasonable easy via telnet on the emulator port.

Change-Id: I387901a5294674f44399c0726abcc9feea221e8d
Task-number: QTCREATORBUG-13095
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-05-18 09:33:38 +00:00
Eike Ziller
6c2c505228 Merge remote-tracking branch 'origin/3.4' 2015-04-23 09:39:09 +02:00