Commit Graph

252 Commits

Author SHA1 Message Date
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
Eike Ziller
863260f1fd Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/debugger/gdb/gdboptionspage.cpp

Change-Id: I4149e860b6842ea63bff3a7eb9632b7a6c2919d8
2021-03-22 09:52:14 +01:00
Eike Ziller
8a7b9fbdd4 Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: I72ac4dab24021f0272a30400cc801387f0dcb558
2021-03-22 09:24:41 +01:00
Andy Shaw
7ec825be5e Android: Ignore an error when doing an incremental build
Since this is not really an error but it is outputted to stderr,
we need to explicitly ignore it so it does not show an error
dialog.

Change-Id: Ia972cf134278216c317649b5483e3deac683374d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-20 09:29:27 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
Alessandro Portale
ae5255cebd Android: Fix android-*-deployment-settings.json detection
Qt 6.0 + CMake: The name for the Android deployment settings file needs
to be determined by using the build key of the current run configuration
rather than by using the display name of the project root node.

Since in contrast to qmake/Qbs, CMake does not supply us with the file
name and we have to contruct it ourselves. Therefore, it makes sense to
move the value into the Android plugin.

This change adds AndroidQtVersion::androidDeploymentSettings which lets
qmake and Qbs still provide the value as before while handling the CMake
fallback.

Fixes: QTCREATORBUG-25209
Change-Id: I12314d06a45d6e045cb654d9140f9d2ed4602f67
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 09:34:48 +00:00
Assam Boudjelthia
6f17ad0562 Android: avoid QTC_ASSERT in addTask
Change-Id: I0b3eee749f21a031ff7b7f910b07719b03585759
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-11-26 19:03:01 +00:00
Assam Boudjelthia
34a7f6f9f2 Android: remove newline chars before adding output in error/warning pane
The output of androiddeployqt that is picked by QC, can contain newline
char at the start of the received line like:
"\nNote: Recompile with -Xlint:deprecation for details."
Such output is sould be only a warning
and not an error, that's we try to remove the newline from the start to
avdoid this behavior.

Fixes: QTCREATORBUG-24881
Change-Id: Iad7556917cb0f53dc691dfb316f999ad504976e9
Reviewed-by: hjk <hjk@qt.io>
2020-11-23 07:23:07 +00:00
Assam Boudjelthia
33b06f5b81 Android: avoid adding ANDROID_ABIS to the project file
Use buildSystem::property()/setProperty() to keep track of the
selected ABI and avoid polluting the *.pro file with it.

Task-number: QTCREATORBUG-24674
Change-Id: I5516a77c9f2d1a8975045e1d7c383e72c52db9d7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-11-05 17:08:46 +00:00
Assam Boudjelthia
62e84f129a Android: fix "uninstall app first" checkbox placement
Change-Id: I2f79e9a5c344e5364fa377422f682f8e0c2927e2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-26 07:13:30 +00:00
hjk
5a97fa53dc Android: Aspectify AndroidDeployQtStep
Change-Id: Ibc2f04336831494c04a2283a59e1f550776c8bf3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-16 07:24:46 +00:00
hjk
97c6c13dcb ProjectExplorer: Remove BuildStepConfigWidget
After the previous changes it was only an empty wrapper around QWidget.

Change-Id: I58dcd82d8342c7de5e2df537044f6cf3de878a67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-06 08:06:39 +00:00
hjk
b97b7dc6f2 ProjectExplorer: Move BuildStepWidget::summary etc to BuildStep
The step is the source of information anyway, and available at the
only place of use. No need to copy that over to the widget, neither
for keeping it up-to-date there when the mechanism is already
available in the step itself.

This creates quite some potential for the simplification of
the various createConfigWidget implementations in follow-up patches.

Change-Id: I4474665f194a1ff7c5792ad086ed53c8d3ce13e6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-05 08:16:51 +00:00
hjk
591e93316d Consolidate build/deploystep default display name handling
Use the display name from the factory as default, override if needed.

Change-Id: I03519c998432fea4120b0de8b2fc2686644635f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 13:18:45 +00:00
Assam Boudjelthia
14024f810e Android: expose deployment warnings and errors to issues pane
This makes the deployment process more transparent and easy to follow
warnings and/or errors.

Change-Id: Ie6a7bde4dfb5748adff1be077299ecdceb0e3930
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-09-14 08:33:04 +00:00
hjk
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
hjk
8cf1b598fe Android: Inline AndroidDeployStepWidget
BuildStepConfigWidget with manual tweaks is good enough.

Also move AndroidDeployQtStepFactory to the usual place at the
end of the file.

Change-Id: I92af31ef77f986b6fcd84a14ac62b70e2da32ff2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-26 10:43:07 +00:00
Eike Ziller
0c4135e380 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp

Change-Id: Id624bad384050d567efba0700046331086cb12dd
2020-08-13 13:28:33 +02:00
Assam Boudjelthia
54b1aaed03 Android: warn about wrong ABI in issues pane instead of general messages
Change-Id: I7b11b0b91f2843ee3d95d86b9afc772295dd6e94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-13 10:49:18 +00:00
Robert Loehning
d4332534de Android: Don't scream at the user
Change-Id: I20ebad6ad2c314394b2c9c90cb9b63e871b2dfb4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-08-11 11:37:36 +00:00
Robert Loehning
cf183a898d Android: Clarify error message
Change-Id: Id85c6a96ec2ffcb3bfd027ffdcc99ff97e1dd8ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-28 10:40:58 +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
Assam Boudjelthia
27514fa94d Android: Warn if the selected device main ABI is not selected
Task-number: QTCREATORBUG-23291
Change-Id: I2ae13edaee30c6548a37e077c18f508a42b42d25
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-23 11:48:51 +00:00
Assam Boudjelthia
def7615c81 Android: fix a title capitalization
Change-Id: I5b22d95b85543f110f7c292d06112c1b72c337bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-22 14:35:11 +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
Assam Boudjelthia
b085091526 Android: handle some TODO comments
Change-Id: Id1848dccc0a9b43ed77c0bd99329a0b81705a17a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 16:40:42 +00:00
Assam Boudjelthia
0bf5ca1b3e Android: rephrase few UI elements in deployment settings
Change-Id: Ief4cf44eda3342f35f828a4a1388ec45fafe8b4a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-25 19:55:17 +00:00
Joni Poikelin
dcf2f16384 Fix debugging for x86 and armv7 Android builds
Fixes: QTCREATORBUG-24191
Change-Id: I7b3033f47a4eb0f63be351576df1540e98edb903
Reviewed-by: hjk <hjk@qt.io>
2020-06-17 10:38:52 +00:00
Assam Boudjelthia
2acca95fab Android: remove ministro deployment option
Task-number: QTCREATORBUG-23761
Change-Id: I5be3c78a009f1747a3ccf7a6bd342969d2b8ece4
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2020-06-15 11:14:50 +00:00
hjk
ca4908bab5 Android: Make two uses of Target::activeBuildConfiguration() explicit
This avoid the QTC_ASSERT that guards the implicit use in BuildStep::
buildConfiguration(). In the current architecture the use cannot be
avoided, but it goes away when Run and Deploy are moved below Build
instead of Target, as planned.

Change-Id: I6020a0854ea99f0102372341163dda6b4b7a8acd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-14 14:46:12 +00:00
hjk
553c3c2c74 Android: Use the new Target::activeBuildKey() function
Change-Id: I051874a2b44129740b2ecc19f7ff401663d8bf0a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-01 13:42:08 +00:00
Tobias Hunger
a3447f6eb2 Android: Fix typo
Fix typo that could possibly cause a nullptr access later on in the code.

Change-Id: I8f17ff52e54fee25b39b7661ee250956b9c513b6
Reviewed-by: hjk <hjk@qt.io>
2020-01-20 10:00:47 +00:00
Eike Ziller
bd5dae90ad Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp

Change-Id: I5e424e34db619bb769c7abc1e8651b7b40210839
2020-01-20 09:59:27 +01:00
Christian Kandeler
07544d4e07 Android: Fix crash when Kit has no Qt
Change-Id: I419bbb68d1d39fa88ca02fb644218ea78216c1ad
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-01-17 12:14:12 +00:00