Commit Graph

191 Commits

Author SHA1 Message Date
Alessandro Portale
79bbe93c1b Android: Make more logged command calls copy&pasteable
Change-Id: I43e01efc4cb583235ad2d97150d4478b23558659
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-09 10:23:16 +00:00
BogDan Vatra
ce95e31766 Fix debugging armv7a & x86 when running on 64 bit targets
We need to choose the preferred ABI based on what it's in the package
not based on what Qt supports.

Change-Id: I243fbf67913af7804af868d507323c0934ad3752
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 14:15:20 +00:00
BogDan Vatra
e21fe24c40 Android: Get the preferred Abi from apk & device
Change-Id: I47325aaec0575dde0e9c9669e61248dac753c670
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-11-29 09:30:58 +00:00
Tim Jenssen
0be200e44e improve code
Change-Id: I06c7274c39f7e369d4cd9bed0c1ef77e4bc08b35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-12 12:22:15 +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
fc2e22dad2 Android: Move logic to trigger AndroidManager::updateGradleProperties
Previously, AndroidManager::updateGradleProperties operated always
on a project node found using target->activeRunConfiguration()
which might or might not be the one that will actually be used
after the build.

This here still does not address the problem that the activeRunConfiguration
may change but introduces a way to specify the relevant node, and tries
to use the right one when available.

At some time, this could be developed into a real solution, e.g.
by invalidating the cache on build key changes.

Change-Id: I37a3d73e9ad3615025e4def2493f683d11add3c6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-01 08:15:55 +00:00
BogDan Vatra
6b31f9cf23 Android multi arch support
[ChangeLog][Android] Android multi arch support for qmake

Change-Id: Ib8b1874604a3392130c96fbc00b26713b3d788ae
Reviewed-by: hjk <hjk@qt.io>
2019-09-16 07:34:54 +00:00
BogDan Vatra
0bf51b9cd6 Android: Add Android 10
Change-Id: I72822b9411f95e868082cf2a5aec885bd809213a
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 06:00:16 +00:00
hjk
3c92742605 Android: Rename ANDROID_TOOLCHAIN_ID to ANDROID_TOOLCHAIN_TYPEID
That's what it is, and it's the only odd one out currently.

Change-Id: If098e2691b9f88fbd5f516cf869e390f43b9ddfa
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-14 09:42:09 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +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
7e2992453e Android: Remove remaining uses of FileName::appendPath()
Change-Id: I33fb650f357d93d177e5977b21b14b42894f571a
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-05-27 09:10:56 +00:00
hjk
dc9cbd8f57 More FileName::appendPath() -> .pathAppended() changes
Change-Id: Ibc7eb4eb3ffb64658e441aafa240b1ddc0061930
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 09:10:19 +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
hjk
f99d69ee43 Utils: Replace mutating FileName::appendString
... by a non-mutating .stringAppended, doing the same.

Change-Id: I7adb6cae3415942cc9a80088bd75cda9d577d4a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 07:42:59 +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
BogDan Vatra
26463a2219 Say hello to Android CMake support
Requirements:
 - NDKr19 or newer
 - Qt 5.12.1 or newer

QtCreator supports the following variables:
 - ANDROID_PACKAGE_SOURCE_DIR
 - ANDROID_EXTRA_LIBS

Be aware, that there is a lot of magic done on QtCreator side, and you
can't use only cmake to build an Android APK.

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

Change-Id: I1d351976ed56f424c2bc972f4ff7b5968147a2ed
Reviewed-by: hjk <hjk@qt.io>
2019-03-06 14:47:27 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
hjk
7a0ae39988 Android: Remove some indirection when finding the minimum NDK
One instance had (base) qt version already at hand, the other was
inside AndroidQtVersion itself.

Also remove the typo in the function name.

Change-Id: I8fb0a1cd11751e4dea1f29a99603ea6b0112c49e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-18 13:34:12 +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
ee483abdb6 Android: Remove DeployConfiguration restriction
... to matching Qt and tool chain.

This is the only remaining place in Creator that refuses to restore
deploy configurations in such cases, and arguably there's no point
in dropping such a configuration as a whole, the individual steps
(i.e. AndroidDeployQtStep) can and do chicken out at deploy time
if there's no Qt version in reach.

Also move AndroidDeployConfigurationFactory to the plugin.cpp,
no need for a .cpp/.h pair for the remaining few lines.

Change-Id: If6ea7cf9573149c88c05629997ac582dc90d1e48
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-25 13:09:06 +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
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
Eike Ziller
04a4bacbf9 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/coreplugin/dialogs/externaltoolconfig.ui

Change-Id: Ie38e9028cee599578c59b22325d85c097335243e
2019-01-07 13:24:12 +01: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
Christian Stenger
1d683dcc07 Android: Correct setting ANDROID_NDK_PLATFORM
Instead of using always just the minimum SDK version
we need to differentiate between SDK and NDK version.

Fixes: QTCREATORBUG-21536
Change-Id: I2f99c9d40ab05ccd2a4b8efeb2cd0300ecf0cf3a
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-12-17 12:41:31 +00:00
Eike Ziller
29c9f8080d Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp

Change-Id: Ibd8b99435365fb7e7d488313fd1d2b3a75adad1b
2018-11-29 13:36:14 +01:00
Christian Stenger
9ee5cab4ae Android: Add Android 9/API level 28
Change-Id: I80b294a20bbfa19f9b83e080caa6e647062f7458
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-11-23 09:10:58 +00:00
Eike Ziller
fd7cba88ef Merge remote-tracking branch 'origin/4.8'
Conflicts:
	doc/src/editors/creator-only/creator-code-pasting.qdoc
	src/plugins/android/androidbuildapkwidget.cpp

Change-Id: Iea8b7135643d14ffe49d10b14bedb8fa5ac48063
2018-10-24 13:58:45 +02:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +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
Vikas Pachdha
8c95ab7ac8 Android: Remove multiple code paths to run adb
Refactor the code to use adb from AndroidManager, do cleanup
and improve logging

Change-Id: I77b682d37c9328e6aa978eaf05b3b5c131907f09
Reviewed-by: hjk <hjk@qt.io>
2018-10-05 12:58:37 +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
Eike Ziller
d09b71d260 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/android/androiddebugsupport.cpp

Change-Id: I01c4880850ad25432a65bb32849365d2aeb0756f
2018-07-10 07:44:53 +02:00
Vikas Pachdha
42754374b0 Android: Parse APK to find package name and other information
Task-number: QDS-16
Change-Id: I228af0711fb2dd64ff96dcb5fc9bc634b556ffd9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-09 08:57:49 +00:00
Vikas Pachdha
f19a6e8ac2 Android: Add API's to run Android SDK tools
Task-number: QDS-16
Change-Id: Ifea5aa17330833cd130555778134fb8f90e2d990
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-09 08:16:22 +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
Vikas Pachdha
b10ada3aff Android: Change the minimum API level supported
Change-Id: Iea6b1720c64810c490e4c9876ecb5ff8c8a9a935
Reviewed-by: hjk <hjk@qt.io>
2018-06-27 07:13:36 +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
ded34daa2b QmakeAndroid: Introduce two new functions in QmakeAndroidQtSupport
... and use them to remove direct dependency of the QmakeAndroidBuildApkStep
on qmake, so it can be merged into the base AndroidApkStep, leaving
less build system dependent code in the QmakeAndroid plugin.

Change-Id: Id7c6a9cb0e51d6b38850a0ad0e0e83a602f53338
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 10:36:37 +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
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
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
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