Commit Graph

197 Commits

Author SHA1 Message Date
Jarek Kobus
f313c5538f Android: Simplify return statements
Change-Id: I100b16a1fd74c4528f61f681bbeb5cdb4adddee5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-04 09:52:39 +00:00
hjk
1c4f973365 ProjectExplorer: Replace the fromMap error return value
... by some out-of-band mechanism, keeping previous functionality.

The driving reason is to get the same fromMap signature as in the
AspectContainer base, however, the whole mechanism seems rather useless:
There are only a few places that actually ever could report errors,
in those places "moving on" looks ok, too, and these few places
are not conceptually different than a lot others.

Removal of this (new) mechanism is left for later.

Change-Id: Ibe7a0456bc3b84a84e942231f14446e783372d76
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-24 06:31:51 +00:00
hjk
53d06feecd ProjectExplorer: Change ProjectConfiguration::toMap signature
To match better with the rest, especially the base AspectContainer.

Change-Id: Ide0966cab3219800aa6b7b9e6012731a3fbe7a6f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-21 16:12:15 +00:00
Jarek Kobus
47ac604aea AbstractProcessStep: Use task tree for all subclasses
Introduce AbstractProcessStep::runRecipe() virtual method
with the default implementation.

Task-number: QTCREATORBUG-29168
Change-Id: Iac75f4c38f8ee91ad8ac9324bb27881a3722911f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 06:48:58 +00:00
Jarek Kobus
f507eec207 AndroidBuildApkStep: Employ task tree for running
Task-number: QTCREATORBUG-29168
Change-Id: I40fb62ae33e436ba79cad852bf4661f72fb45bda
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-07-13 15:18:56 +00:00
Jarek Kobus
b37b94f0e5 AbstractProcessStep: De-virtualize finish() method
Provide a setDoneHook() setter instead. The hook is
introduced temporarily, as when all the subclasses
are transformed to use the task tree, the done hook
is going to be a part of the subclass' recipe.

Task-number: QTCREATORBUG-29168
Change-Id: Idbc0f8b8a32c8df2fa5ecb73ed1cbaedad99620d
Reviewed-by: hjk <hjk@qt.io>
2023-07-13 06:50:07 +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
hjk
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +00:00
Alessandro Portale
3eb60d80e5 Android: Skip "Make Install" and "Build APK" if not ProductType::App
If the target's product type is not "App", the "Make Install" and "Build
Android APK" build steps need to be skipped.

Fixes: QTCREATORBUG-26980
Change-Id: Ia8bb61d407d040b851a74bad3d23876a7d31af73
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-04-06 13:32:41 +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
Alessandro Portale
b9a24753a0 Android: Fix opening of package location after build
Fixes and consolidates into one common function the package path
retrieval for the eight combinations of:

(apk|aab)(debug|release)(signed|unsigned)

Fixes: QTCREATORBUG-28791
Change-Id: I6e8c54f555b95aca448032783938f9f7f89bc653
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-02-23 13:10:07 +00:00
hjk
c93db0feb4 Android: Replaca a few FilePath::toString() uses
... with more appropriate options.

Change-Id: I47e5c6e629b095cbcb66968352718166f8748daf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-25 07:04:14 +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
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +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
ea35ed9ffe AbstractProcessStep: Merge finish() with processFinished()
Change-Id: Ied15ec3ee9d3bcc80b03b2589d101c65f2fd062a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-05 08:43:21 +00:00
Eike Ziller
371dcc3f26 Merge remote-tracking branch 'origin/9.0'
Change-Id: I58ff80e0be838ef5f149c091b8f74cda415ed53f
2023-01-02 11:19:06 +01:00
Alexey Edelev
803fb4ce77 Replace ANDROID_NATIVE_API_LEVEL with ANDROID_PLATFORM
ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files
starting the NDK version r23b. We should set ANDROID_PLATFORM instead,
to specify the NDK platform version, that exists in all NDK versions
supported by Qt. Also the ANDROID_PLATFORM variable expects the
'android-xx' format as a value, so avoid cutting the 'android-' prefix
when adding the value to the CMake configure string.

Fixes: QTCREATORBUG-28624
Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-23 17:10:13 +00:00
Marcus Tillmanns
eca7044361 Utils: Add std::expected implementation
Adds a std::expected implementation that is compatible with >= C++11.

FilePath::fileContents and FilePath::writeFileContents as well as
FilePath::copyFile are changed to return std::expected.

A couple of macros have been added to aid in using the expected types.

An auto test was added showing how to use the library.

Change-Id: Ibe3aecfc1029a0cf13b45bf5184ff03a04a2393b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-14 10:39:29 +00:00
Jarek Kobus
354f67f11a AbstractProcessStep: Remove two virtual methods
Remove stdOutput() and stdError() virtual methods.
Connect to addOutput() signal in subclasses instead and
filter for desired channel.

Change-Id: Ifd9a2e4ff037776caa706bbdb9634992060172ff
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-13 16:23:49 +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
Jarek Kobus
ebe708c1a3 AbstractProcessStep: Remove processStarted() virtual method
Add concealedParameters / setConcealedParameters instead, to be
used in AndroidBuildApkStep.

Use concealed parameters also on start failure and on done.

By default, concealedParameters() equals processParameters()
(i.e. no sensitive data to hide) unless the implementation decides
to replace some sensitive data (e.g. password) with asterisks.
In this case the reimplementation needs to store separate instance
of ProcessParameters and redirect the pointer of
concealedParameters() into own structure.
This is being done through a call to setConcealedParameters().

Change-Id: I8b1573b007c0f8a10c9592ccaf25e6f088f04691
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-06 22:45:40 +00:00
Jarek Kobus
dfd079f050 AbstractProcessStep: Merge virtual functions
Merge processSucceeded with processFinished into one virtual
function. Leave default implementation empty, so that
reimplementations don't need to call base impl. Move
processFinished into private section. Pass just one bool success
parameter into processFinished.

Change-Id: Ide3e262de0c0c5583c9fec2426fa460b6b74a49d
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-12-02 15:37:16 +00:00
Alessandro Portale
6f7837e5e9 Android: Remove gradle.properties file handling
The modification of gradle.properties files was originally a feature of
the Android plugin which eventually moved over to androiddeployqt.

Moreover, this code got accidentally disabled in Qt Creator 4.10 and was
appartently not missed till now. I only noticed it while "FilePath-
ifying" code in the Andsroid plugin.

This change removes the gradle.properties file handling code from Qt
Creator.

Fixes: QTCREATORBUG-28494
Change-Id: Id4f2722f4965c877a065386b34a71d8368147b08
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-11-30 10:53:56 +00:00
Alessandro Portale
65f27c765a Android: FilePath-ify certificate handling
Change-Id: Ic7bf25567ac74555926d105c03cdac5a9e49b5a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-30 10:29:29 +00:00
Artem Sokolovskii
a130a7ae0b Android: Remove support old cmdline tools
Link: https://developer.android.com/studio/releases/sdk-tools

Change-Id: I9ea7c83af604bfc4b5d5e81b037034b7e148e99a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-11-22 10:10:46 +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
Tim Jenssen
964f539e55 Merge remote-tracking branch 'origin/8.0' into 9.0
resolved conflicts:
* doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc
* src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
* src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
* src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp

and compile fix in materialbrowserview.cpp

Change-Id: I686e7e93ded8ac1afc792942ded47cd9fe4341ed
2022-10-04 13:44:42 +00:00
Petri Virkkunen
1c2ffde787 Android: set release flag when building and deploying apk
...in Release builds

Signed Release builds are now deployed correctly by giving
androiddeployqt the --release flag during the Deployment step
for Release builds.

Unsigned Release apks are now correctly built under the release
directory by giving androiddeployqt the --release flag during the Build
step for Release builds instead of determining build type from whether
or not the package is signed.

Fixes: QTCREATORBUG-28163
Change-Id: I319bc95325c88fb84a5997c9237df65eb7983c0e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-09-30 05:58:47 +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
Eike Ziller
98878872df Android: Use QPushButton for Add/Remove buttons
Make it consistent with the rest of the UI

Task-number: QTCREATORBUG-27801
Change-Id: Ie2930047dde6b18bfd61cb01a17f14de2c6aa7d8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-08 07:28:57 +00:00
hjk
1567d24980 Utils: Replace PathChooser::{fileP,p}athChanged signals
... by a new PathChooser::textChanged signal.

They were both emitted in reaction to the underlying line edit's
textChanged() signal.

Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.

Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.

Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-06 05:01:51 +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
hjk
832c919404 Android: Use more LayoutBuilder in AndroidBuildApkStep
Change-Id: I77f2a74916ab5cde9a00fa0cc1e9bf90f4ca61ef
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-11 07:02:53 +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
Eike Ziller
e46357a220 Adapt to move of options to Edit > Preferences
Change-Id: I6881f658db9eec5059b434bce12093667535d5ac
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-06-28 08:32:22 +00:00
Bartlomiej Moskal
917f0d151b Android: set release flag when signing apk
Currently, signing a package by androiddeployqt automatically implies
the --release option, but there is a fix that removes it from being set
by default. To prepare QtCreator for the upcoming change and not to
change its behavior, we need to manually add the --release option to the
argument list.

Change-Id: I31df1b8252a4444afde95a043848391590f4db82
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-20 08:47:30 +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
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
Jarek Kobus
5127d155d2 QtcProcess: Get rid of setProcessUserEventWhileRunning()
Introduce EventLoopMode enum and pass it to the
QtcProcess::runBlocking() instead. There is no need to
store this setting. By default this value is NoEventLoop.

Change-Id: Icad98b77bec5280b79039b7e5aa4ec408261521c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-25 08:44: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
Christian Kandeler
684f5da066 Android: Try harder to find the right qmake project file
... for adding the OpenSSL libs to.
For the typical Android case of a single application product, this will
do the right thing, and otherwise won't do anything worse than now.

Fixes: QTCREATORBUG-24255
Change-Id: I577f3cbd3fda086b8a7c7c5614d0ca79ff9d46f7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-30 16:54:52 +00:00
Assam Boudjelthia
5ab9d45c5f Android: Add and organize error cases for different steps
Add error messages for cases in the different steps (e.g. build, deploy,
etc.) for user. This makes it easier for the user to know what's wrong
instead of just failing with no explanation.

Change-Id: I96ea65f5c73edf14c2214b699503211b740d029c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 14:50:46 +00:00
Assam Boudjelthia
df904decd0 Android: correct label for build platform sdk in project settings
The current label could be confused with build-tools version, so make
it more explicit.

Change-Id: I96abe9af04e6a6e8518926578411f759b90fc9a0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-10-08 06:52:57 +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
Alessandro Portale
58a9b1e396 Android: Use fromUserInput on paths with potential native separators
Otherwise functions like FilePath::fileName() don't work.

amends: 2d019ed659

Change-Id: Id606cabe77a46dab07d3f8c3f38e852517782176
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-20 14:01:30 +00:00
Eike Ziller
6a99368979 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/processreaper.cpp
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: I353a445b5862f63362ea954749b5565360951283
2021-09-20 13:43:20 +02:00