Commit Graph

121 Commits

Author SHA1 Message Date
Jarek Kobus
7039c06f82 Android: Add updateRecipe
Change-Id: Id934f238cff579208f85af6f8b716871ba0c9321
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-03 12:44:08 +00:00
Jarek Kobus
5984e0f073 Android: Add installationRecipe
Change-Id: Icfbb4feadd62aa922e2e1956a64485e9f7139aa9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-03 12:07:40 +00:00
Jarek Kobus
15e3d26c86 Android: Add licensesRecipe
Change-Id: I19fcd9ac354d1ea0100126c8c3640a19256b2a9e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-03 11:43:55 +00:00
Jarek Kobus
ef85a983c0 Android: Introduce QuestionProgressDialog
It's going to replace AndroidSdkManagerWidget's m_outputStack.

Change-Id: I1307c8413a772d574715db90ddb8fecc05038070
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-03 07:26:28 +00:00
Jarek Kobus
bbd2c81e61 Android: Make workflow item names consistent
Otherwise it's a nightmare to track it.

Change-Id: I6d9ddc1d5e7046307b0aa66ded05023cf884f37b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-02 12:46:20 +00:00
Jarek Kobus
41a278a030 Android: Avoid duplicated "--sdk_root=[...]" arg
The sdkManagerCommand() adds this arg already.

Change-Id: Ibfc151cd5bd994bbbf92907955c93afd500abb3c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-23 10:17:40 +00:00
Jarek Kobus
a204bd2304 Android: Decouple missing packages logic from UI
There is no need to modify UI selection in order to
execute installation / deinstallation.

Change-Id: I205477e5ff0e7b07bfbcd6b5f8f985fcb180884e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-22 12:43:20 +00:00
Jarek Kobus
3a4784ea6c Android: Introduce InstallationChange helper struct
Change-Id: Iae86b86d5966847d3dafe2e119782e2d0ce3cfe2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-22 12:19:31 +00:00
Eike Ziller
e5640386f8 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc
	src/plugins/projectexplorer/projectexplorer.cpp

Change-Id: I682b330a278a329fc6294baeff6a28040abd10bc
2024-04-22 12:18:10 +02:00
Jarek Kobus
592762527e Android: Don't call waitForFinished() recursively
Change-Id: Ic49d040643cfb8f871e24fc617d15c72167e1d3c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-19 14:24:32 +00:00
Jarek Kobus
caf2ad3a67 Android: Get rid of forceReload arg
Split arg-rich reloadPackages() into refreshPackages() and
arg-less reloadPackages().

Change-Id: Icf9ee6c9a805732d9015a49c862d9ba411786c13
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-18 15:18:57 +00:00
Jarek Kobus
5201af6574 Android: Get rid of forceUpdate arg from allPackages()
Change-Id: Ife9b04fc7314ac89447176fed0543949e621979b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-04-18 07:05:00 +00:00
Jarek Kobus
400088fa3c Android: Get rid of forceUpdates arg from filteredPackages()
Inline this function.
Fix const correctness.

Change-Id: I4ff3f9c03e5bc23c0e71ca6635718c89b883308b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-18 07:04:48 +00:00
Jarek Kobus
bd282f1ada Android: Get rid of onLicenseStdOut()
Make code more readable.

Change-Id: Icc01a90d7f1469bb58fba325bca728e002c79512
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-17 13:35:41 +00:00
Jarek Kobus
b8e1b33455 Android: Unconvolute onLicenseStdOut()
Drop notify arg and dispatch it on the caller side.
Return std::optional<QString> and pass the cached output
in case of assertion.

Change-Id: I4e738148ef248bd85a3a9260c07af30bf1586805
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-17 12:45:52 +00:00
Jarek Kobus
3ea0a90720 Android: Make onLicenseStdOut() static
Get rid of private m_licenseTextCache field of AndroidSdkManagerPrivate
and make it temporary variable inside
AndroidSdkManagerPrivate::getPendingLicense() instead.

Change-Id: I20a09f04a90cf1054e01d7c4fc4169493f9750ce
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-17 12:45:11 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
Marcus Tillmanns
290232bfd3 Android: Warn if parsing packages failed
Change-Id: I61f249e1b45f1b9322b189b2781dc2375e9d13ca
Reviewed-by: hjk <hjk@qt.io>
2024-02-27 07:38:20 +00:00
hjk
2beaba4627 Android: Use more direct access to current config singleton
Change-Id: Ica5ba556ac022fe39ed4439d023cda1742344eed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-24 13:41:13 +00:00
Jarek Kobus
63fc22e274 Process: Change signature of waitForXxx() functions
Change the arg to QDeadlineTimer type.

Change-Id: Id3dee0717e44130c16baf7925e5b06346a1a1ad1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-23 07:09:22 +00:00
Jarek Kobus
afc67468e6 Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.

Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:51 +00:00
Eike Ziller
e6ecfa0517 Tr: Move some line endings at beginning and end out of tr
Change-Id: Ibb0aba4d6e58bfe4684a818a894876c1f8f7df15
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-18 09:33:25 +00:00
hjk
0eacd0190d All: Remove some unneeded #includes
Change-Id: If9a8fb5e0b32424e3b37ecf3adefc060f86b3630
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:50:38 +00:00
hjk
68c3103f76 Android: Use a more direct access to the tools' path
Change-Id: I49c574144fd4d6b2edd829538c424465c1fe7f05
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-27 13:03:41 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Alessandro Portale
8432760f9a Android: Make QRegularExpressions static const
Change-Id: I76653261c47a91dc5c3e3368e1961774917bc741
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-23 16:04:06 +00:00
Jarek Kobus
2f5aad0cdb Android: Use QtConcurrent invocation for async run
Change-Id: I275af7c52197ecdb0c02e2e1039b37bd8c9bb1c1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-10 15:36:06 +00:00
Artem Sokolovskii
41aeb175b8 Android: Move tests from sdkmanager class to test class
Change-Id: I2e7be8f33b40d7c67e72efa88ca5528deb046ade
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-20 13:35:16 +00:00
Artem Sokolovskii
b7fde29cdf Android: Extract sdkmanageroutputparser to separate file
- Needed for testing and for improving readability

Change-Id: Ie7a716b204ae0a216d72fa0191d4d05b7708c16c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-14 14:11:30 +00:00
hjk
7faad7b4e8 Android: Move a global regexp variable into a function
Change-Id: I888e11b2e16553cd14e4e07335ef90b8094b6cbf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-13 18:36:07 +00:00
Artem Sokolovskii
020320ab78 Android: Add extension to the package name in SdkManager
- Add "Extension 4" if the name contain "-ext4"
- Fix issue with two Tiramisu packages, now one of them
conatin "Extension 4" in the end.

Change-Id: Ib84807e9401acdef53c3dc1195dc3dc6ef34a57d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-03 10:42:45 +00:00
Assam Boudjelthia
5bbc7ea0f5 Android: Add option to set the build-tools version in project settings
Allow QC to directly set the build-tools version for the project.
Such setting could be in qmake/cmake, however, ideally this value
should be the latest available version, and doesn't need to be written
to the project file. Thus, it is convenient to have this selectable
from QC UI for convience, while developing.

Apart from the first reason for avoiding writing this into the project
file, there is QC limitation which doesn't allow writing such value
to CMake project file.

Task-number: QTBUG-97002
Change-Id: I5d54d36f7900f8445359188d6ae7a8ba14bd3a05
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-01-23 13:01:41 +00:00
Alessandro Portale
6d79c5c2b3 Android: Remove "ndkPath" entry from sdk_definitions.json
Since a long while, an ndk within an Android SDK installation resides
under a subdirectory "ndk/<ndkversion>". The "ndk_path" entry in
sdk_definitions.json is therefore redundant, since the ndk version is
already present.

Qt 6.5+ will provide the ndk version number (see QTCREATORBUG-28629),
without such ndk_path, and therefore it is helpful to contruct the ndk
subpath directly from that version number. For all Qt versions.

This change removes the "ndkPath" entry and the code that handles it.

Task-number: QTCREATORBUG-28629
Change-Id: I5a8f204f87a53a610dbeb9d4c39633582ef209c1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-18 10:11:48 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
0d74be319a Android: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: Id00e2bc736683bb844cc7ba936ac9d21aa204416
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-07 16:30:13 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Alessandro Portale
5c65115271 Android: Convert to using Tr::tr
Change-Id: Ie9110093101b0f49808b4da7b13ac3f47c3bb994
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 10:24:32 +00:00
Jarek Kobus
b885281ce7 Android: Limit the usage of qMakePair
Change-Id: Ic079174e75d3a538d5d97fc3931ddd035623f4a6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-30 17:30:09 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Alessandro Portale
8ad4acdd30 Android: Don't quote log lines with path names
Change-Id: I70f23af46bd6c8318971b20727e4010889bdcebc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-07-17 11:11:45 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
hjk
152b14207c Replace QtcProcess::stopProcess() by stop() plus waitForFinished
... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 08:26:10 +00:00
hjk
aa3bdcb427 Utils: Add a QString-based write to QtcProcess
Centralize some boiler plate and warn about best-guessed cases.

Keep the QByteArray based access as writeRaw()

Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-28 08:20:11 +00:00
Assam Boudjelthia
5454dda249 Android: keep up with sdk tools changing folder structure
The cmdline-tools package used to have the folder structure "tools/bin".
However, latest packages are using the structure "cmdline-tools/bin".
And since subsequent updates we are installing "cmdline-tools;latest"
package, it will be put in "cmdline-tools/latest" folder, so we cannot
extract to that path, or otherwise sdkmanager will complain that the
path is in use.

Currently we extract it and put it under the SDK path, then use it to
install the essential packages, then it won't be used at all. This patch
changes that by extracting the downloaded package into a temporary
location, and use sdkmanager from there directly.

Also, this patch updates the links to the cmdline-tools along the way.

Fixes: QTCREATORBUG-27174
Change-Id: I1f5d0e38f5a026631e8a3852821d85a69d543c32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-17 20:45:07 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
Eike Ziller
9bc9fb5a0d Fix avdmanageroutputparser test
- There is no PLUGIN_DEPENDS for tests, and it wouldn't work anyhow
  because of duplicated symbols. It was interpreted as a dependency and
  the test disabled because no such target exists.
- Move the platformNameToApiLevel(...) function to
  avdmanageroutputparser.h to break the dependency to a lot of Android
  support code.

Amends 78da7e2922

Change-Id: I6933684a76e5291d415c72388caa3df2bee7cbfb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 15:31:13 +00:00