Commit Graph

176 Commits

Author SHA1 Message Date
Alessandro Portale
a04b433489 Android: Remove lldb package handling via sdk_definitions.json
The sdk_definitions.json only briefly listed an lldb package. There is
no need to still support that.

Amends: 6bea157c9b

Change-Id: I6344ea6ed9dd80693d02e86033632dfd2582b773
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-09 08:30:42 +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
72e19f0919 Android: Don't call mutable expressions inside QTC_ASSERT
In order to conform to the theory: "Removing all
QTC_ASSERTs and QTC_CHECKs should not change anything".

Change-Id: Ie8ef58533dfbeec00eaf45d42bcb731d8e2a3136
Reviewed-by: hjk <hjk@qt.io>
2022-12-14 11:58:40 +00:00
Alessandro Portale
6d63430611 Android: FilePath-ify RunnerWorker
Change-Id: If8e8c2ba94047bbb48a2ae5fee68d4c12d952fd6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-12-06 14:24:38 +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
Cristian Adam
d267db91ea Android: Fix compilation with clang-cl and Qt 6.4.0
Fixes the following error:

  C:\Projects\QtCreator\repo\src\plugins\android\androidrunnerworker.cpp(74,54): error: call to member function 'remove' is ambiguous
      const QStringList parts = tuple.simplified().remove('\0').split(':');
                                    ~~~~~~~~~~~~~~~~~~~^~~~~~
  C:\Qt\6.4.0\clang-cl_arm64\include\QtCore/qstring.h(704,14): note: candidate function
      QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
             ^
  C:\Qt\6.4.0\clang-cl_arm64\include\QtCore/qstring.h(705,14): note: candidate function
      QString &remove(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive);

Amends 2846bef563

Change-Id: I03bf54e5a6c8d2cbc0c2842399c84bf12ffece56
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-06 18:44:40 +00:00
Alessandro Portale
a917770053 Replace QtSupport::QtVersionNumber with QVersionNumber
Task-number: QTCREATORBUG-27786
Change-Id: I71a44709c264829f629c9dfce702076eda297a77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:08:39 +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
Jarek Kobus
a98b185e90 Drop Qt5: Android, IOS & WASM: Get rid of QOverload
Add a context object into some lambdas.

Change-Id: I72631aeb36703f8f335f3819796fb52148f1b377
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-20 10:30:48 +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
hjk
d76458a8b6 Utils: Replace Environment::size() check by some isValid() function
More descriptive, and later implementable without full expansion.

Change-Id: Ic3b17ea0b07273f292827a7b63e7695b4bd1cf23
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-03 09:42:26 +00:00
hjk
17ee387756 ProjectExplorer: Dissolve a few uses of Runnable
Change-Id: I71b8f1b00e488360e7f9c136912bc64b5a76609a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-30 14:10:59 +00:00
hjk
99c37ab7b7 ProjectExplorer: Remove RunControl::buildType()
Apparently unused.

Change-Id: I3aac506750735a465d787efeb9ea6a6de6e2c6a1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-30 12:41:13 +00:00
Artem Sokolovskii
bef1bd18f7 Android: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I2530688c44735bc4c69d57f9e8f392867be316f0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-05 11:00:36 +00:00
Eike Ziller
3b2134711b Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/webassembly/webassemblyrunconfiguration.cpp
	src/tools/processlauncher/launchersockethandler.cpp

Change-Id: Iab052af98013aa59282c16f22ae6e9ecb32f50c4
2022-04-20 16:12:41 +02:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Assam Boudjelthia
daebcfdca9 Android: fix typo in previous refactoring for AndroidRunnerWorker
Pre-start adb commands were executed for a second time instead of
the post-finish commands because of typo in variable name, which
now is renamed to avoid confusion.

Amends 1372dfdf7f.

Change-Id: Ia89c7835f4a7b9a4d187479962b591b5980387b8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-11 11:44:12 +00:00
Assam Boudjelthia
2846bef563 Android: fix logcat retrieval on pre Android Nougat
Logcat on pre Android Nougat (API <= 23) was broken because the the
returned output from the adb command had lots of null characters \u0000
in the string, and thus the comparison against the deployed package
name was failing and the pid was always -1. This makes sure to remove
any null characters before the comparison and simplifies the code a bit.

Task-number: QTBUG-101673
Fixes: QTCREATORBUG-26732
Change-Id: I3f185eceab376dbb0f4f11cf628b71e058ee5583
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-22 11:42:11 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
Alessandro Portale
fd1b41af9d Android: Enable locating NDK's lldb-server on Windows hosts
For Windows, lldb-server on the local file system is not a
QDir::Executable, but just a QDir::Files.

Task-number: QTCREATORBUG-26281
Change-Id: I4eb91ad9bce62401a945c46a1d2f94b654f9eaa2
Reviewed-by: hjk <hjk@qt.io>
2021-11-05 08:05:45 +00:00
Assam Boudjelthia
4e3658cfa4 Android: report am start errors in case process returns success
Somehow "am start" command can output to stderr even if the process
reports success, this can cause the activity launch to fail silently.

For example calling "am start -n package/activity --user 2" can fail
if the device has no user 2, however the process result will be success,
and the stderr will contain something like:
 Error type 3
 Error: Activity class {org.qtproject.example.scroll_example/
org.qtproject.qt.android.bindings.QtActivity} does not exist.

And the app won't start.

This concerns mostly extra am start args provided by the user, but not
sure if it might happen in other cases, so make sure to report the
stderr nonetheless.

Change-Id: I9317e118fcf4fe0c3ed83dcc53c1c00564c5148e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 15:08:24 +00:00
Assam Boudjelthia
9ccf355abe Android: put "am start" extra args at the end of the arguments list
Add "am start" extra arguments after all the params used by Creator's
deployment process are added. This in turn help tackle two issues:
1) Allowing users to use [-n] to start a different Activity than the
default one.
2) Won't fail deployment silently is a param is a non supported arg,
where adb would try to start an app but the return code is 0 even if
the that app is not found.

Then, we don't need the warning aspect anymore because after this
change, we would rely on "adb am start" to report an exception, but
the app would start anyway if the case 2 above occurs.

Change-Id: Ie609b748e76a068c66c8a9be1d08ccc050167ad1
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 10:57:43 +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
hjk
bd4a501f15 Replace some uses of HostOsInfo::withExecutableSuffix with FilePath
Change-Id: Id72e9fd04dd4995ff2775ee919f747018cbcc339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 11:48:48 +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
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +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
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
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +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
hjk
5a9b715fed Android: Robustify aspect access by id
Warn, instead of crash in case the aspect implementation changes.

Change-Id: If74cb91395e317765d493a97dcd1cdecc6f94296
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-26 13:45:02 +00:00
Alessandro Portale
bc7d0561c3 Android: Simplify pre-/post-run adb command input
AdbCommandWidget is cumbersome to use and has issues regarding updating
the enabled state of the buttons and the dragging and dropping of items.

Cut the maintenance and replace AdbCommandWidget with a StringAspect,
where one line means one entry, just like several other places in Qt
Creator do.

Some residue remains though: in order to keep project settings
compatibility, we need to convert from QStringList (settings) to QString
(StringAspect) and back.

Change-Id: I3ebfff882358ba2e8c0ac6d5b309e89a84f0554c
Reviewed-by: hjk <hjk@qt.io>
2021-03-26 07:02: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
Assam Boudjelthia
b52ad29f3a Android: fix logcat not fetched when app exits/crash at start
Application output from logcat might not work if an app
crashes at the start, so with this patch we avoid that by
making logcat process fetch logs faster by not getting
the full logs but only the logs starting from the moment
we start the app (using -T arg).

This can be very annoying bug, because when starting the
app from QC it usually only prints "app_package_name died."
which forces the user to go into the logcat manually and
search for an error from thousands of lines.

Change-Id: Ic5ac0389cb28e7c80586490877a697272f3648af
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-11-24 07:51:26 +00:00
Assam Boudjelthia
e9c9440653 Android: allow passing apps arguments via manifest on non-debug mode
Uses 00a1e5da7e1aea373a7e6be1d51e1573ff167dd8.

Task-number: QTCREATORBUG-23712
Change-Id: I9a7e134420b608815589578f3851abf150674fd3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-09-11 10:00:32 +00:00
hjk
51e7bce109 ProjectExplorer: Rename Base*Aspect to *Aspect
In most cases they are used directly, so there's not much Base* in that.

Added the old name as alias as porting help for a while.

Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 07:35:43 +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
Robert Loehning
fb17795a9f Android: Add missing full stop and fix message
sdk_definitions.json does not have to contain 'lldb;x.y' anymore
as this is part of the base installation nowadays.

Change-Id: I39bc988674a8e60b22cd852b890224ac1c87e8c8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-28 17:46:17 +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
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
5bb462e070 Android: fix app logcat not always displayed
Fixes: QTCREATORBUG-23919
Fixes: QTCREATORBUG-23177
Task-number: QTCREATORBUG-23291
Change-Id: Ib053a15f2fd8e491a581268f3630725593186a47
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-07-10 13:05:30 +00:00
Assam Boudjelthia
59aa4f8033 Android: check forward port exist before removing it
Task-number: QTCREATORBUG-24155
Change-Id: I3675a63d5aa85b8d11be9021d1a79fac1390b26e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-08 09:32:18 +00:00
Assam Boudjelthia
41c697a67b Android: silence adb irrelevant SynchronousProcess error outputs
Task-number: QTCREATORBUG-24155
Change-Id: Ibebc48d471ef7aeec37c99eda5c27d5419c913f3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-08 07:08:13 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +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
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
hjk
e115e9b970 Android: Properly split am start extra parameter
Avoids, amongst others, adding an empty item if none is given.

Change-Id: Ieb823e2275ca803088a19a16d7f4238422b149c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-12 09:07:13 +00:00