Commit Graph

49 Commits

Author SHA1 Message Date
Jarek Kobus
34c97ac868 Fix a build with Qt 6
In Qt 6 implicit conversion between QFuture and other types
is forbidden. Make it explicit instead.
See ff0ba7e2d7b91fd5809cb314935a1ca1a436f6c9.

Change-Id: Ie42e6b9b5047ba5eeec9f63fd03179e73f95314d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-05 08:46:43 +00:00
Alessandro Portale
a159af342e Android: Remove unused functions
As found by Cppcheck

Change-Id: I9274fe45ed49099b52b4f8556508ec0adc676386
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-09-15 08:56:55 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Assam Boudjelthia
560f5bfdc7 Android: update to latest SDK cmdline-tools
Also, add the --sdk_root argument which is needed.

Change-Id: I85f9444b35bb31aed9670bd322f2754061cf70c6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 13:26:44 +00:00
Assam Boudjelthia
0cfb9e2bce Android: remove old android tool
Follows af7c218d95, the old android
tool is not useful anymore.

Change-Id: I126ecc24622f2e90465440c86b84cdfb30c103e1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 13:24:38 +00:00
Assam Boudjelthia
b410def067 Android: fix some issues with jdk path detection
* There were two functions to detect jdk path, unified them.
* First try to find jdk 1.8, if not found, look for newer versions.
SDK Tools version 26.x needs jdk 1.8 however, the new cmdline-tools
can work with the newest jdk, so the UI will warn the user if the
selected jdk cannot run sdkmanager potentially because of the jdk
version.

Change-Id: Iee2c378598c26e8a9a8245262110ac20322a2d2b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 09:52:17 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
Assam Boudjelthia
d38a6fe1df Android: allow sdkmanager to parse all generic packages
Task-number: QTCREATORBUG-23829
Change-Id: I29bd70a6703b9537e4a884e5acc53e2e2dd020cb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-05-22 11:01:21 +00:00
hjk
7419e09d0f Android: Settings widget code cosmetics
unnecessary indirections, const, namespaces, ...

Change-Id: I7955a81eafdce3fbb14646a57ce8436b00045278
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-20 10:03:24 +00:00
Assam Boudjelthia
9e057a5536 Android: add support for new SDK Tools package cmdline-tools
The newly added cmdline-tools is not used by Qt Creator.
So QC Android settings will be broken for users who have
an Android SDK installed from Android Studio, or who
updated their SDK package (i.e. tools -> cmdline-tools).

This patch fixes both of the following issues:

1- QC looks for sdkmanager tools under <SDK_ROOT>/tools/bin/sdkmanager,
and with the new SDK it's under
<SDK_ROOT>/cmdline-tools/latest/sdkmanger.

2- QC checks the version of the SDK tools and opens the
old SDK Manager for SDK tools version 25.3.0 or less.
However, since cmdline-tools is now version 1.0, it causes
QC to think this is an old version.

Fixes: QTCREATORBUG-23726
Change-Id: I7e6bbc6840d24d358f68dfa3e229799394ace950
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-04-18 16:31:36 +00:00
Assam Boudjelthia
b9b2145396 Android: parse Android 11 (R) packages
Allow parsing packages of the latest Android 11 (R) with API level 30.

Change-Id: Ia50d2ff23395b79828d47a8f9aeb3880aa131d83
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-20 15:00:13 +00:00
Assam Boudjelthia
38cae133bd Android: don't parse sdkmanager AvailableUpdatesMarker
We don't have logic to parse that part and it's not
even needed, because if an update is available the package
will be listed in "available packages" section. This is now
throwing errors and it's not needed.

Change-Id: I3bb65694fbef9218e5a294d9dbfd9e3f1f4c8333
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-13 16:37:35 +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
Assam Boudjelthia
e3d8c97998 Android: Fix sdkmanager package dependencies parse error
Fixes: QTCREATORBUG-23324
Change-Id: I14829277cc3a121af7da53ecc3bd18d34c0fcc65
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 12:49:45 +00:00
Assam Boudjelthia
0df5d8c2e5 Android: Improve "Add new AVD" dialog
* Re-organize the implementation to create a new AVD
* Use SystemImage instead of SdKPlatform because now
an SdkPlatform can be installed partially with a SystemImage.
The current implementation does not consider the this case,
thus we end up with an uncomplete list of installed system images.
* Add Device definitions with categories (phone, tablet, tv, etc.)
to the creation process (check -d arg in avdmanager create avd).

Task-number: QTCREATORBUG-23284
Change-Id: Id02a71ad452fb423fa2781d06ef3fcf2afa328a9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-13 15:20:05 +00:00
Assam Boudjelthia
88edfdb1b2 Android: fix avdManager sdk parsing of android-Q to android-29
Some of latest system-images have SDK version as android-Q instead of
android-29, this will return an error because currect implementation
looks only for integers.

Task-number: QTCREATORBUG-23284
Change-Id: Ied6663110169edb2a5488b2724d1fa4e46131da6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-09 08:10:19 +00:00
Alessandro Portale
804aec1417 Android: Some const& adjustments
Change-Id: Ib675463d93c060d8ef73a548b5e8943faf98c2eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-06 08:24:14 +00:00
Alessandro Portale
984938a451 Android: Log Sdk manager calls
... helps finding reason for logged parsing errors.

Change-Id: Ia544d7d042e3eb8db04c122fe9f2f8e753e8ef4a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-10 09:36:04 +00:00
Alessandro Portale
51e93af2de Android: Distinguish OutputParser MarkerTag for available updates
Change-Id: Ia8389050d8be71454029e1a2848a29de33391f2a
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-12-06 13:37:55 +00:00
Eike Ziller
14da061c33 Android: Warn if sdkmanager could not be run
Add a line in the error checking for "SDK manager runs"

Fixes: QTCREATORBUG-22626
Change-Id: I63f783b376056a28c106bad1ce8c874acf6897f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-19 13:50:15 +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
611e1ea837 Utils: Encourage marking of raw command line parameters
Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-06 12:22: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
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
Christian Kandeler
c6a6c12f05 Canonicalize some includes
Our canonical style is
    #include <utils/fileutils.h>
rather than
    #include "utils/fileutils.h"
Which makes sense, as such headers will never be found in the local
directory.

Change-Id: I4ca46e90d6c4d19d4b1f235f4c79caad864ef222
Reviewed-by: hjk <hjk@qt.io>
2019-01-10 09:04:46 +00:00
Christian Stenger
10f15f5d1a Android: List extra packages as well
These packages should get listed as well as they contain
(at least on Windows) essential packages.

Change-Id: Ia8fb8fc641ac6d9a7fba8f65a31ef65eae560a99
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-21 14:35:51 +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
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
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
Eike Ziller
6e66b2a078 Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.

Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-28 13:45:20 +00:00
Vikas Pachdha
59e3d9af1e Android: Enable emulator tool installation
Let Android sdk manager UI install the emulator tool. AVD needs this
tool to manage AVD's.

Task-number: QTCREATORBUG-19332
Change-Id: If836c511ca4a5673470d42c14115afa21b1b96fd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-21 10:53:20 +00:00
Leena Miettinen
af97d0ce62 Android: Fix UI text
Change-Id: Ifae94cbd89c2af06b2c44c6a3872a24726b30c59
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-20 12:38:15 +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
35689db652 Andriod: Check Android SDK pending licenses
Pending licenses are checked before installing any package and
the user is provided with an option to agree to license terms and
conditions

Task-number: QTCREATORBUG-19000
Change-Id: I4e149b4a6ac84c1f336bb7c50b0d62a2019c7868
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-10-11 12:02:46 +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
4b1429de55 Android: Add APIs to install, uninstall and update SDK packages
Task-number: QTCREATORBUG-18978
Change-Id: I3e19d665fb5b8a3a562010484735022d7ed333a1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 12:00:47 +00:00
Vikas Pachdha
daee6f6f33 Android: Enable Android build, platform and SDK tools parsing
Task-number: QTCREATORBUG-18978
Change-Id: I84d4ead3180ab818493aff9975a7a9b813fba8d0
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:59:34 +00:00
Vikas Pachdha
0ca97ab2bd Android: Enable parsing of available Android SDK packages
Task-number: QTCREATORBUG-18978
Change-Id: Icb9ba0a3afc3ca4386f056aa9e3de057dc9cdf7b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:59:18 +00:00
Vikas Pachdha
4c4500c605 Android: Make SDK package parsing logic generic
Task-number: QTCREATORBUG-18978
Change-Id: I7e643842d6378a172fcfe5984cec931621ff9c41
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:58:35 +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
Orgad Shaneh
5e8e619dd0 Merge remote-tracking branch 'origin/4.4' into 4.5
Change-Id: I9b7cb3d845628abf69a73a279f5a79202c0976c2
2017-10-04 16:11:17 +03:00
Vikas Pachdha
66a42a7ffb Android: Fix the SDK platforms parsing for SDK tools 26.1.1
Task-number: QTCREATORBUG-18962
Change-Id: I780193be482ebc151931196792068d7c4d1ad808
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-09-28 12:34:59 +00:00
Vikas Pachdha
991663d13b Android: Fix empty output when sdkmanager command fails
Change-Id: I013f35880acd5683f23de49cb388c5ef9d8fc911
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-09-12 06:43:49 +00:00
Vikas Pachdha
3881ff94f7 Android: Fix sdkmanager timing out on slower machines
sdkmanager times out on slower machines or with slower network
connection. Increase the timeout and show timeout message box

Task-number: QTCREATORBUG-18458
Change-Id: I9118024ec1438ef9c18842df2f7431e696c73f92
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-25 09:43:54 +00:00
Vikas Pachdha
05b77e8468 Android: Use sdkmanager tool
android tool is deprecated since sdk tools version 25.3.0.
Use the new sdkmanager tool

Task-number: QTCREATORBUG-17814
Change-Id: I96446f5a64c1c400066b4ac7771c8c7e1bf567ed
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-12 13:41:48 +00:00