Commit Graph

252 Commits

Author SHA1 Message Date
hjk
2fa375671a Android: Use LayoutBuilder in AndroidDeployQtStep
Change-Id: I855227bffa18aef5d547510a9c447071527ddcba
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-05 13:08:17 +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
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
Jarek Kobus
070bfe9387 FutureSynchronizer: Change the default value of cancelOnWait to true
The "false" default wasn't really useful.

This changes the default value to the following usages:

1. AndroidDeployQtStep
   Introduced in 91f136ef3a
   The synchronizer was used to cancel the running tasks inside
   the doCancel(), so the similar behavior should be expected
   when destructing the AndroidDeployQtStep.

2. GitClient
   Introduced in f3106ebafe
   Is used only inside the last line of
   GitSubmitEditor::updateFileModel(). The running function
   (CommitDataFetchResult::fetch) doesn't take QPromise<>,
   so it can't detect if the future was canceled or not.
   In this case this change is no-op.

3. ExtraCompiler
   Introduced in c99ce1f455
   The intention was to make it cancellable and finish
   early on cancel.

4. PluginManager global future synchronizer
   Introduced in 72bddf9f51
   The intention was to make it cancellable and finish
   early on cancel.

The relevant places in code are marked explicitly for
points: 1, 2 and 3.

Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-26 08:17:27 +00:00
hjk
b7ca84c5ee Utils: Remove one LayoutBuilder::addRow() overload
The flexibility here is getting in the way later when trying to
remove the dependency on aspects.

Change-Id: I7221e80f2067292c7c80aead8f6d739fb7878f7e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:07:26 +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
hjk
f423db5cb7 Android: Slim down androiddeployqtstep.h
Change-Id: I8a7cf3c33cc1dea6dd79f4c2bf0808f24a3b2369
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-22 13:27:56 +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
Jarek Kobus
bf059bff7d Android: Replace QFutureInterfaceBase with QFuture<void>
In case a passed future interface is used only for checking for
cancel, use QFuture<void> instead. This will properly integrate
with QPromise API.

Change-Id: I33e5e9c62dbcfb1f7aa71eace6158e5b7c0a7098
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-10 13:09:20 +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
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
Alessandro Portale
fe294fb00d Android: Remove extra margin from AndroidDeployQtStep widgets
Change-Id: I7e91d6b5405c30c4af3a1b19e836b1a19bb5f90b
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:22 +00:00
Jarek Kobus
1e632d0c25 AndroidDeployQtStep: Make it cancelable
And use QFutureInterface for it.

Change-Id: I1145b70b119d92af7316977c813f4f29b1f20b74
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-25 12:15:18 +00:00
hjk
90ee349980 Android: Use FilePath as adb pull target for the deploystep
Helpful when the build dir is not on the local host.

Change-Id: I511ed7e4389a9a4dd5b5504bb35e21aadfb20285
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-14 16:51:33 +00:00
Marcus Tillmanns
06838e3e5e ProjectExplorer: Fix potential race condition
When using BuildStep::runImpl() it was possible for the async part
to still be running while the BuildStep is already deleted.

This change returns the Future so that users can wait for it to finish.

Change-Id: I27c0fc8741c59851c5ab8f5cb858fbcda923c14d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-09 08:33:37 +00:00
Eike Ziller
b402f35481 Merge remote-tracking branch 'origin/8.0' into 9.0
Conflicts:
	doc/qtcreator/src/qtquick/qt-design-viewer.qdoc
	src/plugins/qmldesigner/components/assetslibrary/assetslibrarywidget.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
	src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp
	src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
	src/plugins/qmldesigner/designercore/model/abstractview.cpp
	src/plugins/qmldesigner/designercore/model/import.cpp
	src/plugins/qmldesigner/designercore/model/model_p.h
	src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp

Change-Id: I4236bf0da9306abf201f4679259e72dd7c1eddbe
2022-11-01 15:38:49 +01:00
Alessandro Portale
acfd71831c Android: Fix crash in AndroidDeployQtStep
info.cpuAbi in AndroidDeployQtStep::init can be empty, for example when
opening a configured project with a different Qt Creator version, and
the "No valid settings file could be found." message appears.

Check for !empty(), before accessing the first item.

Fixes: QTCREATORBUG-27795
Change-Id: Ife0bf495ed8ea7bfb342300ee2e457398c8ee8f2
Reviewed-by: hjk <hjk@qt.io>
2022-10-21 11:12:41 +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
hjk
4a5c3d871d Android: Clean up JavaParser a bit
Change-Id: I8d5113c7916f816d34a1eacc0b978645d710b2be
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-28 06:11:08 +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
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
Alessandro Portale
139e190d77 Android: Cleanup qtc.android.build.androiddeployqtstep logging
Reduce excess spacing and quoting.

Change-Id: I685d78a91494f5805a175552db36df92d3da3ca5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-06-27 19:31:19 +00:00
BogDan Vatra
aaf2318a19 Fix Android debugging
- gatherFilesToPull depends on AndroidManager::setDeviceAbis
- use the same path for app_process. gatherFilesToPull pulls app_process
to AndroidManager::buildDirectory(target) which might be different than
activeRunConfig->buildTargetInfo().workingDirectory.

Change-Id: Id47c4380fed5a8b3ad922359e5f9f25e529bacff
Reviewed-by: hjk <hjk@qt.io>
2022-06-23 08:25:43 +00:00
Jarek Kobus
41f9962ea6 AndroidDeployQtStep: Don't handle unfinished lines separately
Automatic handling of unfinished lines should be fixed
in cfe8b7ad88

Change-Id: I9f4bcf876ce5d7d51b651b6e997b7891d4483c56
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-25 11:15:54 +00:00
Jarek Kobus
bd7949f852 AndroidDeployQtStep: Make m_process local
There is no need to keep m_process as a class member,
since it's only used in just one function.

Change-Id: I156b978a18ab25a41b0e52d00fcb90c0f7f12ddd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-24 09:43:57 +00:00
Eike Ziller
e914f42458 Merge remote-tracking branch 'origin/7.0'
Change-Id: I9c4ef46084fd392663c7c21c4ecdbc578ea28577
2022-03-18 08:42:02 +01:00
Assam Boudjelthia
03abdcda9f Android: don't fail if device abi list is empty
If for some reason the device abi list is empty, don't stop the
deployment, let it continue and potentially fail later.

Amends c1512dce87.

Task-number: QTCREATORBUG-27103
Change-Id: I484fbd1ddb365d5e96686eebc3ba76032684e506
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-17 09:21:10 +00:00
Assam Boudjelthia
851171f772 Android: rename avdname to avdName in AndroidDeviceInfo
Change-Id: I9f4743b0d9f953f1fa407acfea41345571cb9998
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-14 17:48:31 +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
Assam Boudjelthia
c1512dce87 Android: don't stop deployment if the kit's ABIs list is empty
If for some reason we cannot get the list of kit's ABIs or it's not set,
don't stop the deployment because of that, let it continue and fail
later.

Fixes: QTCREATORBUG-27103
Change-Id: I973e5ffdca1e8fb6af3f6e6438969b38b8e375c8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-23 17:21:51 +00:00
Alessandro Portale
2cd7d89ec5 Android: Remove a cast in AndroidDeployQtStep::init
Don't do an additional dynamic_cast.

Change-Id: Icf3beda4e78bc03232689439e8ba264287b603ab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-16 17:17:44 +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
Assam Boudjelthia
9a859de175 Android: fix error message when no valid device is set
Change-Id: Iff48a94100490222e039355c4e7558f1d79dc7b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-09 13:33:34 +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
f49fbe7f58 Android: set the deploy step widget to expanded by default
The deploy step widget most useful aspect is the uninstall before
deploy checkbox, and having it expanded by default would improve the
UX a bit by avoiding one extra mouse click.

Change-Id: I23ebc90daf9290d229d93dca1b9b25629902e3f2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-12 10:59:13 +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
Assam Boudjelthia
7bf268114d Fix issue with deploy step not getting valid abi with CMake
With CMake, it seems that the abi was being empty string because
looking for ANDROID_ABIS is not defined and instead there's ANDROID_ABI.

Also make sure to handle the case of ANDROID_ABIS, which might be
declared in future versions like Qt 6.3 which can support multi-abi
builds.

Change-Id: I805c5c25409a4e20a237b8747082d256bd72e275
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-21 06:07:41 +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
Assam Boudjelthia
a2b6dba0bc Android: fix for retrieving the path to deployment file and build dir
The Android deployment file for CMake project was constructed based
on the main project target and thus was always expecting the file
to be under the build folder root path. This makes sure the correct
path to the output path is retrieved.

This practically different problems with running examples when the
main project is a Qt module, for both qmake and cmake.

Fixes: QTCREATORBUG-25793
Change-Id: I5fdedd94c7c4c84c351c28476ca14b0f95f99f22
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-15 11:02:21 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Alessandro Portale
3a26271660 Android: Fix build
Amends: e92418edca

Change-Id: I40615c2fa6e9b9cd98976c9ebfc56a9bdf1dd612
Reviewed-by: Aleksei German <aleksei.german@qt.io>
2021-09-07 11:44:48 +00:00
Assam Boudjelthia
e92418edca Fix minSdkVersion in deploy step
Deploy step uses AndroidManager::minimumSDK() which looks for the
version in the AndroidManifest.xml file which used to contain the
minimum and target sdk, but if the manifest doesn't contain that
value, this logic returns 0. So, return the defaultMinimumSDK()
in case the first way fails.

Change-Id: Id10e552d7c8de4d3544b7fa8f26ae5dd9e974df5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-07 11:11:45 +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