Commit Graph

284 Commits

Author SHA1 Message Date
Assam Boudjelthia
67df868f5c Android: Automatically use the correct NDK for each Qt version
Based on change 286266, we can find a correct NDK version for Qt for
Andriod version. This change allows Android plugin to get relevant NDK
information and registers appropriate toolchains and kits settings.

[ChangeLog][Android] Automatically use correct NDK version
corresponding to used Qt version.

Task-number: QTCREATORBUG-23583
Change-Id: Ic6b0d7a1ae8962c075b77498de88e018a008ac3e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-17 16:14:50 +00:00
Assam Boudjelthia
f46099d21e Android: Automatically download SDK tools and essential packages
Automatically download Android SDK Tools to default path
used by Android Studio, then essential packages will be installed
using the sdkmanager tool. Automatic installation can also be
triggered by an added button in the settings page.

Essentials packages include NDK Bundle and other NDK versions
required by previous Qt versions.

An sdk_definitions.json file holds download paths for SDK Tools,
and other (Qt version <-> essential packages) combinations.

[ChangeLog][Android] Automatically download SDK Tools, NDKs and
all essential packages for Android builds.

Task-number: QTCREATORBUG-23285
Change-Id: I90e7aafecd017d2bdc959e403711d9d440a6bbb2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-07 18:21:30 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
Alessandro Portale
b7acfc37b5 Android: Remove "qtlive" support
Productization of Qt Live preview for Android didn't happen.

Change-Id: Ie69d8193afec9b59d859bc65c45d36028247e2b9
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-12-18 05:46:53 +00:00
Eike Ziller
15b2765dff Update Qt validity in options when changing Android device settings
When changing the Android device settings and pressing "Apply", the
information in the "Qt Versions" tab is no longer correct.

The Abi information is parsed from the mkspec, and that depends on the
NDK setting in the environment.
When the NDK in the device settings changes, it updates the toolchains,
and that triggers a re-validation of the Qt info in
QtOptionsPageWidget::validInformation, but since the Android Qt version
already has tried parsing the mkspec, and got (possibly empty) Abi
information, it never is parsed and updated again.

We need a way to force BaseQtVersion to update these things again.

Fixes: QTCREATORBUG-23095
Change-Id: I9cb55ad1a73db942804637344e4c856c7e95afd3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-20 11:28:47 +00:00
Christian Stenger
358574f44d Android: Fix compile for gcc 5.3
Change-Id: Ic70d6507babeb4b782ace7fb62c37485335311e1
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-17 05:28:31 +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
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +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
Alessandro Portale
a38c3ac08e Remove ToolChain::suggestedDebugger()
And inline it in AndroidConfigurations, which is the only place that
made use of suggestedDebugger()

Change-Id: I87f135b5d115adb7e46b0f009c5853221e9a3daa
Reviewed-by: hjk <hjk@qt.io>
2019-06-12 12:54:43 +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
2ac89cba92 ProjectExplorer: Use an alias for QList<Abi>
Change-Id: I69231c5974620ae30296bfc4e0ab41c900d95a3c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-27 09:35:53 +00:00
hjk
0595e67c82 More FileName::pathAppended()
Change-Id: Ie20ec34ea9712b3ec49e6233b23cef84c2019f03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 14:37:13 +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
0e4df97f90 Some more FileName::appendPath -> pathAppended() changes
Change-Id: Ia05b54f157b08353d5a9efccee48dfc212d3a489
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 13:19:58 +00:00
hjk
d1f9e466da Utils: Introduce a non-mutating FileName::pathAppended
... and start using it. The plan is to replace all appendPath() uses.

Change-Id: I555bcfa742b99b0951b98b0c0e707422c348fadb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 11:45:24 +00:00
BogDan Vatra
dd9086530f Android: Nuke mips[64] support
There is no mips[64] support in Android anymore.

Change-Id: Ia7829e06c8e5658fb6ee9d20ea34d621a9651f37
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-07 15:08:03 +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
Christian Kandeler
d6dfa7fa77 ProjectExplorer: More registerKit() simplifications
Change-Id: I61c9e9886f3952b2823433a5c94aedd441ebe7f1
Reviewed-by: hjk <hjk@qt.io>
2019-03-12 14:44:37 +00:00
hjk
f1eac5f30a Android: Simplify Kit creation logic a bit
Instead of creating and destroying in some cases only create the ones
that will be used.

Change-Id: I5c3200101ec21b4a4cf1e3c6e91bf94153278b5c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 14:44:28 +00:00
Christian Kandeler
3aea3a13cb ProjectExplorer: Refactor KitManager::registerKit()
The interface of this function was rather unfortunate. In particluar,
the fact that it took ownership of the std::unique_ptr that was passed
in required some weird boiler plate code at all the calling sites.
Instead, it now becomes a proper factory function.

Change-Id: Iecdc6f6345232fc0f0a08bffaf8f1780edb57201
Reviewed-by: hjk <hjk@qt.io>
2019-03-12 10:16:33 +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
da4d395ff4 Android: Cosmetics for AndroidDevice interface
Change-Id: I291f51a3baeb3768428485c63914627c0d91037b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-17 16:27:59 +00:00
Eike Ziller
8d19b306ed Android: Detect clang and gdb from older NDK
Get some minimal compatibility with the older NDK that is used for
Qt < 5.12 back.
This detects clang-3.6 and gdb from NDK 10e.
For building, the android-g++ mkspec continues to be used for Qt < 5.12
(it uses Qt's default mkspec, regardless of toolchain in the kit,
because the toolchain reports to support both).

Task-number: QTCREATORBUG-21595
Change-Id: I3487c38093f43ccae2418fb28807a50fbda101a8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-29 14:28:59 +00:00
Ivan Donchevskii
e164717108 Android: Fix clang executable suffix on Windows
Change-Id: I78e8e49efd52d33f9f26f554a3400fabbe74d9ed
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-11-16 12:07:51 +00:00
Vikas Pachdha
de97b8cf3e Android: Auto detect clang toolchains
Remove GCC auto detection
Make Clang toochain default for Android
Remove auto detected toolchains from old NDK

Task-number: QTCREATORBUG-11846
Change-Id: I618e6f8eda4f24f498260b8de778ef543311acd1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-11-02 15:10:50 +00: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
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
BogDan Vatra
25264d9bd9 Fix debugging on Android arm64/x86_64
On Android 64, there is no lib/ symlink anymore, so we need to upload
gdbserver from QtCreator.

Change-Id: Ib6f6d9b623dc61b72dd434ce1b3b409e880bdeaa
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-10-04 15:36:35 +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
Tobias Hunger
f685e2bfb4 KitManager: Use unique_ptr to manage kits
Change-Id: I8c66290f0d23afe37673bd858f7db135c8232a78
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-25 10:30:27 +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
Eike Ziller
98479ba312 Merge remote-tracking branch 'origin/4.7'
Change-Id: I00b0009867322be55c215351054acc7de5b9e335
2018-07-12 14:56:13 +02: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
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
ed30522bb8 Android: Fix aapt tool's path in windows
Task-number: QTCREATORBUG-20750
Change-Id: Ie35675d789007a6c79b979b4520dc0ecc83c688c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-10 05:29:49 +00: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
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
Eike Ziller
bb28b10add Introduce static_container_cast
Casting all elements of a container, similar to qobject_container_cast.

Change-Id: Ib455fe8c7fa0d4acda7e29685c3100638a0152f8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 13:44:51 +00:00
Alessandro Portale
1dbdd259be Remove some obsolete code inside QT_VERSION_CHECK sections
With Qt 5.9 as minimal build version, we don't need to handle 5.7 or 5.8

Change-Id: Ie1eed95ab46364452b0633f78bebc565a4a63f4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-27 07:43:49 +00:00
Ulf Hermann
8e9454010b Android: Make qmlscene command configurable
Change-Id: Ife1dd4ae9fa3bcc822c27d744c3ed626bae99b8f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 14:03:39 +00:00
hjk
b0b4022470 Android: Some code cosmetics
The naming scheme of the internal object was changed
to the usual pimpl pattern.

Also setup device update connection in the device constructory

Change-Id: I5cbb7a9d870a7d1f0e91e54f2ad6dfb95ea63e37
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-14 10:12:07 +00:00
hjk
7ab872ce6a Android: Remove dependency on plugin object pool
Change-Id: Ic6908cca581a0d6155c8c43c86163347ca578a4c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-01-30 10:21:18 +00:00
Eike Ziller
f42ea09b74 Do not construct settings/resource paths from QSettings object
These paths are controlled by ICore.

Add ICore::installerResourcePath() to replace constructions with
settings(SystemScope)
Replace constructions with settings()->fileName() by usage of
ICore::userResourcePath().

Change-Id: I5a9fa9d09f2563c39dc5d11a4586da825c62f9ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-11 10:42:09 +00:00
Ivan Donchevskii
ebdeb87241 Android: fix make command for latest NDK
Change-Id: I8c54ac146a96c11d6df5a7e5c791314799119b5f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-11-20 11:08:56 +00:00
Vikas Pachdha
5754b7d09f Android: Fix Sdk manager system environment
Android native tools fail if JAVA_HOME environment variable is
not defined

Task-number: QTCREATORBUG-19072
Change-Id: I3db910b34d9bdd9ebc9ba052b5300ecf5ef3ce15
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-12 07:59:52 +00:00
Vikas Pachdha
c52ee5238b Android: Enable common arguments for SDK manager command
Task-number: QTCREATORBUG-18978
Change-Id: I9f3e2b16a77ff949268960d2b5c5aa1896fa3770
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-10-11 12:01:29 +00:00
Vikas Pachdha
e70179e14f Android: Add API to check whether to use native SDK UI tools
Task-number: QTCREATORBUG-18978
Change-Id: I1cf4749e81b3b49de14ff88a5876569886d2cdfe
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:59:46 +00:00
Vikas Pachdha
ec4fe5f04f Android: Refactor Android SDK packages
Introduce a hierarchy for Android SDK packages and refactor the
code accordingly. This is ground work for sdk management and
automatic android setup

Task-number: QTCREATORBUG-18978
Change-Id: Idef545e3b3a8e33e920be52b26094fb8046afcd3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:58:16 +00:00