Commit Graph

236 Commits

Author SHA1 Message Date
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
Assam Boudjelthia
c7061af61f Android: don't throw error on adb's "All files should be loaded." log
When installing a signed apk, adb might throw the following log
"All files should be loaded. Notifying the device." which is being
treated as an error and will stop the deployment from going forward
until user input is given. The current condition is not catching it
probably because it has a \n at the end, but let's treat it as a
warning.

Change-Id: If071730b39871b4e60f8755d14ba352b86e7c244
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-06 07:04:27 +00:00
hjk
062006b07f Android: Use FileUtils in AndroidDeployQtStep::createConfigWidget
Change-Id: Ib2ca0dbcdc811a6c130bf921845484b95039d076
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-24 11:45:58 +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
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
Christian Stenger
d97335c4ea Android: Use line-based output callback
Change-Id: I5d2ede450ee3e36cc16d7f1566083125204ce552
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-06-09 06:38:02 +00:00
hjk
fde88f9f07 Android, Debugger: Simplify setUseCtrlCStub callers
The Windows-only restriction is nowadays handled inside QtcProcess.

Change-Id: I77d6914831ff172026665a429b497940c60970ac
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-04 09:59:28 +00:00
Christian Stenger
4f0759d7ea Utils: Remove couple of functions from QtcProcess
Some functions do not work and should therefore not be used.
Line-based processing of the output interferes with the internal
automatic usage of the ChannelBuffers.
Remove the respective functions and move the line parsing over
to the client.

Change-Id: Iaaa58c181e35e132fae863ddb808547142c99221
Reviewed-by: hjk <hjk@qt.io>
2021-06-03 13:40:03 +00:00
hjk
accb1e6e08 Utils: Make QtcProcess::{setW,w}orkingDirectory use FilePath
But keep the old setter for a while to ease transition.

Change-Id: If02b79b1fcd31fbf8b06ef26876c41af891127f9
Reviewed-by: hjk <hjk@qt.io>
2021-06-03 10:31:13 +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
hjk
770d87709e Utils: Join SynchronousProcess::run and runBlocking implementations
Make functionality dependent on an (intentionally ugly)
setProcessUserEventWhileRunning call.

Also, back-paddle a bit on API combination of QtcProcess and
SynchronousPrceoss for now and prevent the QtcProcess-and-
runBlocking and SynchronousProcess-and-start combinations.

Goal is still to have all in QtcProcess in the end, but this
may take a while.

Change-Id: Ic146ec5db0ab8dc9613e5b2af5f4dc90bc7465ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-25 06:40:01 +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
b2dc771d80 Utils: Simplify QtcProcess::exitMessage() interface
This was requiring parameters the process object already knows.

This is a slight behavior change in most cases, it now includes
always the command line arguments, which previously only happened
in gcctoolchain.cpp and iarewtoolchain.cpp.

Change-Id: Id25a68c397e2f1d8bf52ab29210e215b1de46c6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-17 08:59:48 +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
Alessandro Portale
a25ea9febe Android/iOS: Don't add markup to display names of build steps
The display name is continuously read and written from/to settings.
Let's not add markup each occurrence, it accumulates.

BuildStep::summaryText has the logic to add the markup for the UI.

Change-Id: Ifbb74ccb8d2f0adcebbd69cc012a5b1376154934
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-03-26 11:21:36 +00:00