Commit Graph

51 Commits

Author SHA1 Message Date
Assam Boudjelthia
1e765e5963 Android: add environment to removeAvd()
Valid for windows hosts, otherwise, the command might fail.

Change-Id: I3e759c74ea0a785fd226cda08f301f0cce17c9b7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 18:50:55 +00:00
Alessandro Portale
ebc6e1fc62 Android: Use Android tools environment for avdmanager call
Otherwise AVD creation fails (on Windows).

Change-Id: Iff11c2cd96c214b40b714b6b1248adede54da343
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-28 10:14:59 +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
Alessandro Portale
bf2088075d Android: Don't crash in AndroidAvdManager
cancelChecker is an optional parameter.

Change-Id: Ie47ae834a34f8ebf8c901e4dcaf7a9c3af5c0ce4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 09:21:20 +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
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
e2cf0b52a7 Android: Don't check QtcProcess exit code
This is already baked into QtcProcess::Result.

Change-Id: I02b017c7d26b5c42ea4e00cea5c3b393274edfdc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-02 14:21:23 +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
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
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
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
Alessandro Portale
7b6d44a90a Android: Introduce constants for Android ABIs
Avoiding string duplication prevents typo-related runtime errors and
allows an IDE to use find symbol rather than plain text search.

Change-Id: I7fba7c7c5cf90c0b371efce3b575537b2708dd0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-26 05:49:49 +00:00
Assam Boudjelthia
f936e7c10d Android: rephrase few logs
Change-Id: If03a15c88caab210fd07c61312757317ea86af2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 20:10:16 +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
af7c218d95 Android: remove native sdk and avd manager buttons
The native SDK and AVD manager buttons are no longer useful, since the
original, visual Java-basd tool for managing SDK and AVDs were removed
from Google's offering. The replacement is a set of command line tools
and a visual tool within Android Studio, which can not directly be
launched from Qt Creator.

Qt Creator has it's UI on top of the command line tools.

Change-Id: If660d7f566c173f46d9b2a97c9204746d33270e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 07:15:07 +00:00
Christian Kandeler
f4f9d9cdbb Android: Remove some unused variables
Change-Id: Id6d8f0735c410a331c406a3f3a094aac5f03f5a9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-04-23 09:20:17 +00:00
Assam Boudjelthia
2555f4b8dd Android: Fix UNINIT_CTOR and PASS_BY_VALUE issues
Change-Id: Ie77e69226769d9ea0440611f2f5985c5ec08beaa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-11 08:52:48 +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
ae79b40561 Android: Fix AVD info parsing for renamed instances
Android Studio's AVD manager renames the AVD info file to match the
instance ID.

Task-number: QTCREATORBUG-23448
Change-Id: Id8ff0a53ae93b168c55442166072d14c5c84d2e0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 21:19:56 +00:00
Alessandro Portale
e25212e2c5 Android: Log various avdmanager invocations
... in order to to understand what Qt Creator does when creating,
deleting or launching AVDs.

Change-Id: Iebcc9273746ad89069870ee09dab67c127b10be9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-14 08:11:15 +00:00
Assam Boudjelthia
d4ce0b6cfe Android: Remove unnecessary block of code from AndroidDeviceInfoList
Task-number: QTCREATORBUG-23284
Change-Id: I006ed8b63e979b4e3b27035f3b6838870ea7a11b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 08:10:49 +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
6a5b182706 Android: fix avdmanager parsing error for some new device types
Currently avdmanager tool can give an error
"Error: Google <device> no longer exists as a device", due to missing
definition for new devices in device.xml.

This change temporarily removes the tag "hw.device.manufacturer" to
parse successfully, then recover it back.

Task-number: QTCREATORBUG-23284
Change-Id: I9c6f4b432d7c5d16944c9b620c4a4ecda473d45a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-13 12:19:19 +00:00
Assam Boudjelthia
6d897c00f4 Android: Add more informative fields to AVD manager UI
Task-number: QTCREATORBUG-23284
Change-Id: Ic93de1c05731360b85925acd23bdca12edc56069
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-08 08:36:44 +00:00
Alessandro Portale
8e5b587b3d Android: Log invocations of avdmanager
Change-Id: I32e4fe3d837adcb6860247f45757187902566934
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-08 05:48:40 +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
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
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
BogDan Vatra
4b98f52c0e Android: fix avd creation for google play images
Latest avdmanager doesn't support "--tag" argument anymore and it fails
big time.

Change-Id: I9b1296a1813623d44add3e9e783b8395e6865cf2
Reviewed-by: hjk <hjk@qt.io>
2019-05-03 07:00:43 +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
Tim Jenssen
f0f142d4c8 setReadChannelMode -> setProcessChannelMode
setReadChannelMode is obsolete since some time

Change-Id: I91567d38d3509c7d1b174da4e6ca160c4b5d8452
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-07 14:29:02 +00:00
Christian Kandeler
966f4ea6a9 ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.

Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-31 16:10:01 +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
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
Ulf Hermann
ab152497a0 Android: Merge output channels of AVD process
Otherwise, if the process produces a non-0 exit code, we get an error
message with only the stdout, which likely is empty.

Change-Id: I3b84f928cf786015aab499cdc2277d530d243841
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-22 07:32:47 +00:00
Eike Ziller
62050437c3 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp

Change-Id: Ia723411f4b5c9c90f9786223ac6a7346d7ab9b99
2018-04-26 10:16:32 +02:00
Vikas Pachdha
83d8de3366 Android: Check for AVD startup failure
Task-number: QTCREATORBUG-20160
Change-Id: Ifbae6d10da6c782e701bc7840ce4324526d0dd82
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-20 05:26:10 +00:00
Vikas Pachdha
503fb603c3 Android: Set proper environment for the avdmanager tool
Task-number: QTCREATORBUG-19988
Change-Id: If34b4ff570ed6d6fdbb91435913d9130feceb499
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-20 05:25:33 +00:00
Vikas Pachdha
6e4ae817c2 Android: Check for missing emulator tool
Task-number: QTCREATORBUG-20160
Change-Id: I481adfe9a7a1b2c9c151d01d2fe1b010735c898b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-19 10:05:03 +00:00
Vikas Pachdha
717c7bfd9f Android: Add explicit tag for google_apis system images
Task-number: QTCREATORBUG-20298
Change-Id: I9bc4d9192584ffbc1180ae7b69f334c915ca16f4
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-04-19 06:30:34 +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