It's not used by any bootstrapped tool anymore.
Pick-to: 6.2 6.3
Fixes: QTBUG-100074
Change-Id: I92cf441c200174e73b483cb4f08bab6c3e7d9c09
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Some of the parameters in the help information were indented by 3
characters instead of by 4.
Pick-to: 6.3
Change-Id: Id11cda79d61c4eab82ee09e33034db55730123c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
These were added to QStandardPaths in commit 68c4669ce4
[ChangeLog][QtCore] PublicShareLocation, TemplatesLocation got added as
known locations to QStandardPaths.
Task-number: QTBUG-86106
Task-number: QTBUG-78092
Change-Id: I453b6a07dd7775f81f81a1b18fa95f5c1230cb1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Extend the logic extracting enum base classes to flags
to handle things like QAbstractItemView::EditTriggers.
Exclude the Qt namespace.
Amends de15836dbf.
Fixes: PYSIDE-1773
Task-number: PYSIDE-1404
Pick-to: 6.2 6.2.3 6.3
Change-Id: Ib0cd0836a91f330e5bc3307690062a965abec7eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
We can detect if QML module has the embedded into the plugin QML files
using the 'prefer' record from qmldir files. No need to duplicate QML
files inside the android_rcc_bundle if 'prefer' record starts
with ':/'.
Pick-to: 6.3
Fixes: QTBUG-95984
Change-Id: Iee4f2248e3c0239c4f95a5db6e8fb3f16be636c5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Instead of copying all files that the QML module directory contains,
this approach only copies files that belong to the QML module
according to the qmlimportscanner output.
Pick-to: 6.3
Fixes: QTBUG-97834
Change-Id: I881a6fba28ca24be4f33de8693b41b6dfefe8d6b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Binaries with multiple slices (e.g. arm64, x86_64)
will have an extra line for the slice, like:
“/path/to/QtGui.framework/QtGui (architecture arm64)”
The parsing code will skip this line since it does
not match the regexp. In other words the parsing works
by looking for lines which matches, and finding lines
which don’t match is not an error condition.
Pick-to: 6.3
Task-number: QTBUG-98466
Change-Id: I0afebdc0dd19e76de00157518f3409d690f18fc0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Only use shellQuote() if the path is actually passed to a native API.
For QFile API, use the unquoted path.
Fixes: QTBUG-97649
Pick-to: 5.15 6.2
Change-Id: I9d8131819010bbd2faa8a81eef367245d90a767f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
cmake_automoc_parser has the logic preventing the run of moc with the
--collect-json parameter if metatype json files are not changed.
This logic only verify if the file list is changed but not their
content. This change adds a timestamp file that contains the last
metatype json file timestamp that was modified during the last
cmake_automoc_parser run. The logic still prevents of running
'moc --collect-json' when the list of metatype json files is not
changed, but also checks if their content is no changed.
Another approach it to generate the depfile that can be utilized by
CMake in add_custom_command as DEPFILE argument. But this concept only
works from the second build attempt because of an issue related to
dyndep.
Pick-to: 6.2
Fixes: QTBUG-98532
Change-Id: I713f8bfa9ae769cefe0beac0b7fa19750b00a765
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qt_internal_${target}_copy_apk_dependencies should use CMake DEPFILE
approach when it's possible. Since we don't have any specific
artifact that androiddeployqt can produce when collecting dependencies
this change adds simple timestamp file that is touched each time when
androiddeployqt is running. The timestamp is used then as a file-level
dependency for the qt_internal_${target}_copy_apk_dependencies target.
Task-number: QTBUG-88841
Change-Id: I985535c7b6e471cb4cfbf90128628087dadc72d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of generating external projects that build the project tree
for each target, this creates a single project for each ABI that have
the common for all targets configure steps. Each executable target
then adds additional build step to each ABI-specific external project,
that builds and copies dependencies to the "main" project build tree.
To resolve dependencies from the build tree, when building multi-abi
apk instead of scanning the build directories of external projects for
dependencies, it makes sense to run androiddeployqt for each
ABI-specific external project to copy all necessary libraries. This
is done by adding --copy-dependencies-only flag to androiddeployqt
that only copies the apk dependencies, but avoids creating apk and all
the essential steps. The ABI-specific external project now handles the
deploying of the build artifacts to the end-point apk deployment
directory and the "main" project assembles the apk using collected
artifacts. The ABI-specific external project uses the
qt_internal_${target}_copy_apk_dependencies target to run androiddeployqt
with the introduced --copy-dependencies-only flag.
TODO: Build steps that build and copy the ABI-specific apk
dependencies are non-skipable and will run each time top-level build
is triggered. This behavior should be fixed by adding dependencies to
the generated by androiddeployqt DEPFILES for each ABI in the
top-level build.
Task-number: QTBUG-88841
Tash-number: QTBUG-94714
Change-Id: Id442a9fbd589f58b70f4204c5215645056b379a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET
allows passing an export macro. This is useful to avoid exporting the
whole class just to get the staticMetaObject hidden therein exported.
Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject
subclasses, being polymorphic, always need to have a class-level
export macro (to export their vtable), but while that technique also
works for value classes (the Q_GADGET audience), it is not desirable
for them, because it makes inline functions exported in Windows debug
builds, which is not what we want, because it needlessly restricts
what you can to with the inline functions (e.g. remove).
[ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like
Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT
for Q_NAMESPACE).
Fixes: QTBUG-55458
Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Having all *deployqt tools in qtbase will allow us to couple deployment
support more tightly with the build system.
Change-Id: I299efdacfa6b66a303bb3996ff3ff84e723210a5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
We have some special handling in qt_windows.h,
use it instead of the original windows.h
Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The file was inadvertently removed in
ad2da2d27a.
Pick-to: 6.2
Change-Id: Iaaf74d7ae382b0c9487fb25a58632dfc5be6538d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This allows us to present 'qmake' in the tool-related section of the
configure summary.
Change-Id: I897dec23cb0608706ec01d9b91283dbce92b293f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This makes it possible to turn off the build of the Android deployment
tool.
A new src/tools/configure.cmake is added that will be the place for all
tool-related features in qtbase.
Change-Id: Ic9264c93ee96de06c97d21d2f27f73256f48ffda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Removed content describing androiddeployqt from deployment-android.html
to androiddeployqt.html,the qdoc source now living in qtbase.
Docs src locations added to the qtcore.qdocconf.
Task-number: QTBUG-97842
Pick-to: 6.2
Change-Id: I94783520280098ce1ab35f335a644bea70b8131a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
There are still more failures, but these are low-hanging fruit.
Pick-to: 6.2
Change-Id: I3d3a1dc9e754bd4865c850cc1549b0b6fd6fa2f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously, when running unit tests on Android, the log presented
to the user was the log as known to the Qt logging system. This
does not include log messages generated by Java code using e.g.
Log.d("message"). Neither does it include log messages by system
libs. This patch changes androidtestrunner to capture the full
logcat output for the unit test. This improves the developer
experience when working with unit tests.
Fixes: QTBUG-93438
Change-Id: I580f728349041eb8a84a32d187754b7b5448f512
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Add --no-rcc-bundle-cleanup option to androiddeployqt tool that helps
to debug android build procedures and check the raw rcc bundle for
missing items. Also add the QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP
CMake variable that adds the option when configuring projects for
Android.
Change-Id: I1f30ba979f9fb3274e44a53fdc5ebde4e65f0843
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Use QDir::removeRecursively instead of deleteRecursively when cleaning
up top-level build folders.
Change-Id: Ifb406fc1965a0781eab4fd63a3764a84f4309d25
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The TraceLoggingValue template does not have overloads for Qt
types, so it was throwing multiple template instantiation errors
while trying to log the unknown types.
Fix it by serializing such types to QString using QDebug::toString,
and the logging this string.
Apart from that, fixes some other compiler errors on Windows build
with -trace enabled:
- implicit size_t to ULONG conversion
- complaints on std::min
- add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE to the generated
*_tracepoints_p.h headers to fix the namespace build.
Task-number: QTBUG-97246
Fixes: QTBUG-97241
Pick-to: 6.2
Change-Id: Ifba134bab8d7fda7f1e30da9938e25cae813e1c6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The tracegen tool was not taking into account that Qt could be build
with a custom namespace. As a result, the combination of namespace
build and tracing enabled was not working, because tracegen generated
classes without the namespace.
This patch fixes it.
We cannot add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE because of the
tricky logic that recursively includes the generated header file
multiple times, also including the code like
static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
(hash)include TRACEPOINT_INCLUDE
NULL, /* Dummy, C99 forbids 0-len array. */
};
where TRACEPOINT_INCLUDE is the path to the generated header.
This patch is using QT_USE_NAMESPACE, wrapped into some #ifdefs.
This should be safe, considering that the generated trace headers
are only used as private API.
The windows tracing support seems to be broken even in a
non-namespace build, so it's not handled in this patch.
Task-number: QTBUG-97246
Pick-to: 6.2
Change-Id: I12db76e199a3aa3abde641fbf99a6e1a3d7de203
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
It happens on Android Automotive emulator, that output file is in other
directory.
According android spec [1]:
"If a default user isn't specified, each adb subcommand has a different
user. The best practice is to retrieve the user ID with am
get-current-user and then explicitly use --user <userId> for any
command that supports it."
That is the reason why output file can be found in
/data/user/USER_ID/PACKAGE_NAME directory.
Checking path related to current user was added as backup solution.
[1]https://source.android.com/devices/tech/admin/multi-user-testing
Pick-to: 6.2
Change-Id: Id7e6ddef74f4f20b7469a07bba6a71d3622c4e20
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
None of the bootstrapped tools use zlib anymore.
Change-Id: I2cd7cb855ed671916a21c23449d9b6c4506f8546
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The use of ndk.dir in local.properties is deprecated in favor of
android.ndkVersion in build.gradle, and will be totatlly removed in
the future, so we need to adapt to that.
Fixes: QTBUG-91391
Pick-to: 6.2
Change-Id: I54c57113a759d43c3685c9cdf2b9dcc5c948c0fd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
There's no need to dereference+reference a QList's iterator
only to pass the result to an algorithm, just pass the iterator.
Change-Id: I7367010f6ab489d951715259bd51aeec790d3c84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need to reinevent the wheel. Also, use nanoseconds
now that we have the precision available.
Change-Id: I287d06198edc3f5bdf7f85bd5f3e235b1fea95a3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This will allow us to make changes in QtCore itself, without having to
worry about moc compatibility.
The output uses an #ifdef so this version of moc can still be used to
compile earlier versions of Qt (usually, in cross-compilation
environments). See discussion in the mailing list[1].
[1] https://lists.qt-project.org/pipermail/development/2021-September/041732.html
Change-Id: I2de1b4dfacd443148279fffd16a39784c80c5f3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
androiddeployqt writes a list of architectures into the build.gradle
file. This list should only contain the architectures which are enabled.
This patch adapts the generation of this list accordingly.
Amends 07cfab07a2.
Change-Id: I5c7c1886c54cc3b9a7e42af6eefbaf2a067a67d5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The "qt" property can also be filled with a json object like this:
"qt": {
"x86":"/home/.../Qt/6.3.0/android_x86",
"x86_64":"/home/.../Qt/6.3.0/android_x86_64",
"arm64-v8a":"/home/.../Qt/6.3.0/android_arm64_v8a",
"armeabi-v7a":"/home/.../Qt/6.3.0/android_armv7"}
That allows to update the options.qtInstallDirectory when changing the
current architecture.
The "qtHostDir" property is also added to provide the path to the qt
host installation (rcc, qmlimportscanner).
Change-Id: I3f0c36cc7a7030d45adc1a4dccaaad61dd538aea
Task-number: QTBUG-88841
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When building for armeabi-v7a, building and APK using
"ninja foo_make_apk" works. Building it by calling
"gradlew assembleDebug" works. Opening the "android-build" folder
in Android Studio and clicking the "Build" button works.
But clicking the "Run" or "Debug" button in Android Studio does not
work when the attached phone is arm64-v8a. Then Android Studio
automatically selects the v8 architecture which does not find the Qt
libraries. This patch adds explicit ABI selection to the gradle
configuration files. With explicit ABI selection, Android Studio does
not try to outsmart you.
Pick-to: 6.2
Fixes: QTBUG-96701
Task-number: QTBUG-87022
Change-Id: I4ad6356c38b7eca004c0e0dbbb357cab7de84c0f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In the Android gradle files, the variable qt5AndroidDir refers to Qt5
and might confuse users. This patch renames to qtAndroidDir.
Pick-to: 6.2
Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Introduce a new macro qt_internal_return_unless_building_tools which
simply calls return() if tools are not built. This macro is supposed to
be called after qt_internal_add_tool().
Using this macro avoids having to special-case code for when
qt_internal_add_tool() creates imported targets in cross-builds.
Adjust pro2cmake accordingly.
Task-number: QTBUG-85084
Change-Id: I9e1c455c29535dd8c318efa890ebd739c42effc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The jarsigner command that was being used was malformed before the
file path leading to wrong signing command. A sample of the malformed
command part "-storepass password⍣/path/to/package", note the char
after 'password'. So having auto produces a QStringBuilder that's
returning the malformed char.
Fixes: QTBUG-96838
Change-Id: I5477f6913a74d79ebaf029ef7f4e2745c9f7ced0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit f492790611fe15a4745c8ad0c97259f438c91b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is required to generate the correct import for Python.
Pick-to: 6.2 6.2.0
Task-number: QTBUG-63235
Change-Id: I6aaff82058e3f0a5453da15d8d470f06ad9a5a16
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
The rcc tool doesn't contribute to the build of QtCore anymore.
There's no need to link it against the bootstrap lib.
Change-Id: I5272d439a05f852eeea88b3a6b95c5ad6dd4e987
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the project consists of an executable and multiple libraries that
are linked to the executable, currently you need to specify them
manually using QT_ANDROID_EXTRA_LIBS target property.
This automates deploying of the libraries that are a part of the
project build tree. _qt_internal_collect_target_apk_dependencies
collects all the known non-imported shared libraries from the project
build tree. When running androiddeployqt we specify extra library
directories that point to the collected library locations in build
tree, to help androiddeployqt resolve shared libraries that are build
as a part of the project.
The described procedure is running automatically if CMake version is
greater than or equal to 3.18 is. For the CMake versions less than
3.18 users need to call a new public qt_finalize_project function at
the end of project's top-level CMakeLists.txt
Task-number: QTBUG-94714
Change-Id: I400ca4e49e940cfc25ae90d65372e79825bee55a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
If application uses qml files from multiple locations, e.g.
subdirectories inside source directory it's important to provide this
information to qmlimportscanner to produce consistent set of QML
modules that need to be included into the end-point application apk.
This makes possible to specify more than one QT_QML_ROOT_PATH per
target and propagates these paths to the qmlimportscanner using
androiddeployqt tool.
Pick-to: 6.2
Task-number: QTBUG-93340
Change-Id: Ic31017b3f2671108adb6d6118ef1c75f1ccc3ec5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When doing a cross build for Android we need only the host tools which
are available under cmake's host_tools target, but androiddeployqt and
androidtestrunner are not part of that. This fixes that.
Pick-to: 6.2
Change-Id: Icdbc4a78ca050b66ec8df656d9ec766ef6c9f4b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Some Qt modules/tests go through features that require run-time
Android permissions which are granted by user input, that of
course is not ideally possible while running unit tests. So when
installing the app adb can do that for us.
Pick-to: 6.2
Change-Id: I92d33d5213c3779d7ca246ec0fb359d2ead4fa6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
By the time of Qt 6.2 release all new apps targeting Play store must
target API level 30 (Android 11) or above (starting in 08/2021 for
new apps and 11/2021 for existing apps' updates).
Pick-to: 6.2 5.15
Task-number: QTBUG-94451
Change-Id: Id7fa2fd62899a7259e365c917292c6c3ac0d2b0d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
qdbuscpp2xml can't know about custom types registered with
qDBusRegisterMetaType<> in the server application whose header file
it's parsing. So add support for custom types using a command line
argument. For example:
qdbuscpp2xml -t 'std::vector<Person>=a{ssss}' peopleserver.h
which generates
<arg name="people" type="a{ssss}" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="std::vector<Person>"/>
[ChangeLog][QtDBus][qdbuscpp2xml] Added a -t option to specify how to
handle custom types.
Change-Id: Ic0cad4f4eec8d5dfa48055c3a46cc772b1a60174
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>