Commit Graph

423 Commits

Author SHA1 Message Date
Alessandro Portale
d4efd4a369 Android: Improve prior commit
Actually use the version variable that was defined prior to the line.

Amends: 0de09fe3a3

Change-Id: Ie05e1a4e1be0fa0729dd1de38fc6b5351d02d380
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-04 14:53:26 +00:00
Alessandro Portale
0de09fe3a3 Android: Enable manual adding of NDKs v22+
Don't enforce the presence of a "platforms" subdirectory if the NDK is
of version 22 or higher. The last NDK version with that directory is 21.

Change-Id: Ib431e7db4521533206304d252dcf93b7ea6169e5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-03 14:33:02 +00:00
Assam Boudjelthia
d5a3435798 Android: drop const from AndroidConfigurations::currentConfig()
Since the config can be expected to modify configuration values
(e.g. setEmulatorArgs()) it shouldn't be const, but can be set
to const whenever creating a reference that is not meant for
modifying the config.

Change-Id: I8c816a5422d4d57afa158c723d908e3a9a9a0db8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 18:34:58 +00:00
Assam Boudjelthia
ec55b1a483 Android: remove AndroidDeviceType and State from AndroidDeviceInfo
No need to have these enums which are now only a duplication of
IDevice::MachineType and IDevice::DeviceState.

Change-Id: Icc3f112f2670c7354bb282b36fad0f0631b9e047
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 09:21:37 +00:00
Assam Boudjelthia
336cee445e Android: Remove unnecessary parameters in AndroidConfigurations
No need to manually provide a parameter to adbToolPath inside
AndroidConfigurations itself, functions that needs it can just
get it directly.

Change-Id: Ie319e82e4ea3b7e3ad6588284168f6116bef2686
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:59:03 +00:00
Assam Boudjelthia
6e4d829a40 Android: handle return correct serialNumber for a running avd
AVDs don't get a serial number until they are started, and avdmanager
don't make it easy to get their serial either, so we need to check
the running devices with adb "emu avd name" command and compare.

Change-Id: I3253d25a3461a36eb9918b3c796062bf9e82e0c6
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:58:27 +00:00
Assam Boudjelthia
78da7e2922 Move sdkmanager's sdk level parsing to AndroidConfig
Both the sdkmanger and avdmanager (maybe more) need to parse the sdk
level for packages and devices which may contain letters, make them
use the same logic.

Change-Id: Iff7fef3a66e00fac11b833f73f2f334a4cf1a766
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-13 14:56:06 +00:00
Assam Boudjelthia
c94d5a257b Android: few fixes for android kits aspects
Make some changes to make Android kits behave as, for example,
desktop kits:
* Set the build device of the kit to the default desktop device.
* Don't make the device and toolchain aspects sticky.

Change-Id: I41a40c6ed8dc3434fa4f3a09349b75b5fd379317
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 08:08:05 +00:00
Assam Boudjelthia
91117a1c36 Android: Clean up for extraData constants
clean, rename and delete unused constants, we well as unify the
usage between qmake, cmake, and qbs.

Change-Id: I8827ac2f2f7660e337694fef17f744e727bd776a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-06 08:07:42 +00:00
Assam Boudjelthia
96255208a5 Change device selection mechanism on Android
Currently, on deploy/debug steps on Android, an AndroidDeviceDialog
is popped up each time a deployement is done to select a device. This
can be avoidable by using Qt Creator DeviceKitAspect to have the list
of devices easily selectable from the project mini-menu.

This is better than the current way because it:
* reduces the time from deployment to running the app
* reduces the number of clicks
* avoids having to select the same device each time or
* if a default device is selected, this avoids having to go to project
settings to reset the default device to be able to deploy to a new
device.
* it looks cleaner and more compatible with Creator.

Task-number: QTCREATORBUG-23991
Change-Id: Ida4ab7245c1a3b0ca26c5ccdc9a21a072edf0725
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-21 15:33:40 +00:00
Artem Sokolovskii
2d22dbe612 Android: Use FilePath
Change-Id: Ia1cf2a615f0de70038a575f851572e944a9797df
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-17 11:37:35 +00:00
Jarek Kobus
686603ae83 Remove unused includes of QThread from cpp files
Change-Id: I61b8e9182bf03fa96d2aabe399a6c93964fc8d03
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 10:37:20 +00:00
Eike Ziller
8e51295959 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/libs/utils/processreaper.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
2021-09-07 11:05:40 +02:00
Assam Boudjelthia
bf3dae64a2 Android: fix toolchain path retrieval for NDK r10
Although, recent Qt versions (Qt 5.12+) don't really need r10, this
can be useful if an older version is used, or if the user wants to
explicitly use Ndk r10.

Change-Id: Ic88929a747bcea89384a7bae9d8f8b26135fae65
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-03 17:06:02 +00:00
Eike Ziller
987ad3fe9c Merge remote-tracking branch 'origin/5.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/android/androidconfigurations.cpp

Change-Id: Icd2b0fda2b2653656285bbbe457c30c9cd414d3f
2021-08-30 12:15:37 +02:00
hjk
3b75ca96d6 Utils: Remove FilePath::isWritablePath() uses
And fix remaining users.

Change-Id: I41c27908f2e9f1e253d0b51830ba351b29a84ec5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-27 07:05:29 +00:00
Assam Boudjelthia
b3a12e1ab9 Android: Don't register multiple debuggers for each ABI
After NDK r10x, there's one common gdb executable instead
of separate for each ABI. Currently, multiple debuggers
are being registered for each ABI although they all share
the same command. Apart from simplifying the list of debuggers,
this will make it less time consuming where each NDK can register
one instead of 4 debuggers.

Also, there was two functions handling debugger registration for
the default NDKs and another for custom ones chosen manually by
the user. Now, they are merged together instead.

Change-Id: I886b6fa8eb2190e630189f9002e7a44cd18c7b71
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-08-26 10:58:04 +00:00
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00
Assam Boudjelthia
cd8da8fe5f Android: Get the minimum sdk level based on the used Qt version
Currently, Creator gets the minimum sdk version from a hard-coded
value (16) which is used for all projects. However, this is not ideal
because some Qt versions require a specific sdk level to build and run
properly. So, this change ensures that the minimum sdk value is obtained
based the Qt version used in the project.

Fixes: QTCREATORBUG-26127
Change-Id: I948dd18d16c3d9ca587ad7712aa4c9a1bfd53972
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-26 08:03:09 +00:00
Eike Ziller
34a884a52a Android: Clean up messed up kits that were created by Android plugin
No idea how to reproduce, but it can happen [1] that stale Android kits
appear in Qt Creator, which have broken combinations of Qt version and
toolchains. The Android plugin updates the Android kits at startup,
but only updates known "correct" kits, or creates new ones.

Additionally remove any previously auto-created Android kits that
were not recognized to be still usable.

[1]: probably after switching between a working Android setup and a
broken one, with broken toolchains/debuggers brought into the mix

Change-Id: I709f52df62f8998647e4d68bdfe76015e8941ab8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-26 07:19:46 +00:00
hjk
1b6c212928 Android: Use FilePath operations in AndroidConfig::parseDependenciesJson()
Change-Id: I32bd5cbce4f486132be338c4318f499ce0b03325
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-25 05:38:02 +00:00
hjk
823e48a1fb Android: Partially FilePathify BuildApkStep and AndroidConfigurations
Change-Id: Ie7a7ae9f0d30235eab3dbcab9554fdfa1709a3c1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-19 03:02:29 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
Alessandro Portale
99700bb009 Android: Enforce portable/clean Android SDK path
When reading a path from file chooser, settings or environment variable,
make sure it is portable and "clean".

Avoids extra compiler registrations, invalid Kits and similar issues.

Fixes: QTCREATORBUG-26092
Change-Id: I2a11563f40973d5f595bf00e37ff045a503aa9f7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-16 07:31:12 +00:00
Assam Boudjelthia
45611e841b Android: avoid blocking call to show avd selection for default device
If a user already chose a default device to run, we don't need to create
the whole AVD selection dialog, but rather straightforward to get the
device info if it's already connected, otherwise the dialog opens for
selection as usual.

Change-Id: I5fee9411d755e89da23a8d365f284e8b52808a07
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-07-22 08:51:46 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
c0fe038f93 Utils: Simplify FilePath::toFileInfo().lastModified() calls
It's the same as FilePath::lastModified locally, and toFileInfo
doesn't work remotely. So it's overall at least not worse.

Change-Id: Ice8d80dcfd01dc38edc1dce2b53e1b5e6274380f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-22 08:57:28 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
Assam Boudjelthia
1372dfdf7f Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-01 08:11:56 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Eike Ziller
c213b93aff Android: Make avd output parsing testable
And add some tests

Change-Id: Ife0e0c60f55251a1ac23215055ece8fb01478d59
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-10 09:47:04 +00:00
hjk
5813c7e8c2 Utils: Make SynchronousProcess use Utils::Environment for environments
Makes the interface more similar to QtcProcess.

Change-Id: I58e57d9fdb7c37eb0d2a5c5eef8643d6be97c3cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-05 12:14:31 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
Alessandro Portale
670616c6f9 Android: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I1242a5c62a27b7b8f30bb7b43ff406eceb4135f7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-23 10:51:37 +00:00
Eike Ziller
4bc2b4741d Merge remote-tracking branch 'origin/4.14'
Change-Id: I842a7c7358fd0ff6d85c151806e440043914e09a
2020-12-14 14:19:15 +01:00
Assam Boudjelthia
f167811fb1 Android: fix Android SDK default path on macOS
Fixes ec68b4e96c.

Change-Id: I07b3a627c77d363c1e7e3b2ecc1222e211792959
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-14 09:34:47 +00:00
Eike Ziller
1283b15117 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	doc/qtdesignstudio/examples/loginui1/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui2/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui3/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui4/qtquickcontrols2.conf
	share/qtcreator/debugger/dumper.py
	share/qtcreator/debugger/qttypes.py

Change-Id: Id44a67cdeeb0889ff96eddcdf409d20ca7cbdd0b
2020-12-10 13:02:02 +01:00
Assam Boudjelthia
ee199c3fed Android: setSticky behavior to follow other platform's kits
Don't set the whole kit's values to sticky, instead set only
device, toolchain, qt version properties to sticky to follow
the behavior of other platform's kits.

This also allow users to set specific CMake version for the kits
in case the selected one is not correct, since Android plugin doensn't
handle that anyway.

Fixes: QTCREATORBUG-25042
Change-Id: Ia6f6474b5ad9132e841e6e7024113439649b61f1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-09 07:38:30 +00:00
Christian Kandeler
9cbcbfff33 Fix various clang warnings
Unused variables & functions, unneeded copies in range-for loops,
missing overrides.

Change-Id: I27b60e7c92a6ca425a84c89b537d5c3815449a94
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-08 15:39:20 +00:00
Assam Boudjelthia
ec68b4e96c Android: fix SDK path on macOS
Change-Id: I369cf218eb2fd42ede04a6cb6b638d6fa6282994
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-07 11:51:40 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Alessandro Portale
323f353c6c Android: Replace AVD partition-size spinbox with emulator args input
The android emulator supports many more command-line startup options
than "-partition-size". Let's allow the user to take advantage of the
full functionalty, by providing a free-text input field for the options.

A link to the online documentation is also provided.

As a side-effect, the issue that an overridden parition size can cause
the "Cold Boot: different AVD configuration" warning is solved by not
having -partition-size by default.

Task-number: QTCREATORBUG-24735
Change-Id: I41d7b826133708c7ff447c1e257f62368745dea1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-07 11:25:28 +00:00
Eike Ziller
3f42c989ee Fix Qt 6 build of ProjectExplorer and targets & build systems
QStringRef is gone.
qsizetype vs int.
QMultiHash::insertMulti is gone.
QXmlStreamWriter writes UTF-8 by default.

Task-number: QTCREATORBUG-24098
Change-Id: Id217e40a1f17993a84fc725976e9cb84618b0580
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-21 11:31:54 +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
Alessandro Portale
b6e4c9e133 Android: Remove some unused functions
Change-Id: I5c6549ed931b5132898abd6ce519560851838e65
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-09-10 11:38:50 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00