diff options
author | Alexey Edelev <[email protected]> | 2024-01-29 13:27:28 +0000 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2024-01-30 03:17:02 +0000 |
commit | 9e6dbdb4fc586d3e381408fa340046cf49e74e7d (patch) | |
tree | b1a454d342b51e3bf8d44836c90a94b5e109cd9b | |
parent | 498658b72ebe75c1a9044cddcdb0a69514ea7442 (diff) |
Revert "Add the support of the qt_import_plugins functionality to androiddeployqt"
This reverts commit 6763644c3fc151d6e7716af08531a386557d5a88.
Reason for revert: Breaks android automotive and blocks the release.
Change-Id: I450dca047d7f105bd60bab3fb698806ef486e581
Reviewed-by: Jani Heikkinen <[email protected]>
(cherry picked from commit de62bb90ec829bd88fa91c48c4061d61cb1f6a71)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 219a0aabc118916c3be16e647a2a1411805cb15a)
-rw-r--r-- | cmake/QtAndroidHelpers.cmake | 3 | ||||
-rw-r--r-- | src/corelib/Qt6AndroidMacros.cmake | 6 | ||||
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 70 |
3 files changed, 24 insertions, 55 deletions
diff --git a/cmake/QtAndroidHelpers.cmake b/cmake/QtAndroidHelpers.cmake index 0743fe41a96..5bfabdfb7a0 100644 --- a/cmake/QtAndroidHelpers.cmake +++ b/cmake/QtAndroidHelpers.cmake @@ -253,8 +253,7 @@ function(qt_internal_android_dependencies target) # Module plugins if(module_plugin_types) foreach(plugin IN LISTS module_plugin_types) - string(APPEND file_contents - "<bundled file=\"${INSTALL_PLUGINSDIR}/${plugin}\" type=\"plugin_dir\"/>\n") + string(APPEND file_contents "<bundled file=\"${INSTALL_PLUGINSDIR}/${plugin}\" />\n") endforeach() endif() diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index c0319fbdb3c..9a8d02165f2 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -236,10 +236,6 @@ function(qt6_android_generate_deployment_settings target) _qt_internal_add_android_deployment_property(file_contents "android-no-deploy-qt-libs" ${target} "QT_ANDROID_NO_DEPLOY_QT_LIBS") - __qt_internal_collect_plugin_targets_from_dependencies("${target}" plugin_targets) - __qt_internal_collect_plugin_library_files("${target}" "${plugin_targets}" plugin_targets) - string(APPEND file_contents " \"android-deploy-plugins\":\"${plugin_targets}\",\n") - # App binary string(APPEND file_contents " \"application-binary\": \"${target_output_name}\",\n") @@ -307,7 +303,7 @@ function(qt6_android_generate_deployment_settings target) # content end string(APPEND file_contents "}\n") - file(GENERATE OUTPUT ${deploy_file} CONTENT "${file_contents}") + file(GENERATE OUTPUT ${deploy_file} CONTENT ${file_contents}) set_target_properties(${target} PROPERTIES diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 7378cb83888..d34fc5082a7 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -144,7 +144,6 @@ struct Options QString qtQmlDirectory; QString qtHostDirectory; std::vector<QString> extraPrefixDirs; - QStringList androidDeployPlugins; // Unlike 'extraPrefixDirs', the 'extraLibraryDirs' key doesn't expect the 'lib' subfolder // when looking for dependencies. std::vector<QString> extraLibraryDirs; @@ -1013,11 +1012,6 @@ bool readInputFile(Options *options) } { - const auto androidDeployPlugins = jsonObject.value("android-deploy-plugins"_L1).toString(); - options->androidDeployPlugins = androidDeployPlugins.split(";"_L1, Qt::SkipEmptyParts); - } - - { const auto extraLibraryDirs = jsonObject.value("extraLibraryDirs"_L1).toArray(); options->extraLibraryDirs.reserve(extraLibraryDirs.size()); for (const QJsonValue path : extraLibraryDirs) { @@ -1889,32 +1883,6 @@ QList<QtDependency> findFilesRecursively(const Options &options, const QString & return deps; } -void readDependenciesFromFiles(Options *options, const QList<QtDependency> &files, - QSet<QString> &usedDependencies, - QSet<QString> &remainingDependencies) -{ - for (const QtDependency &fileName : files) { - if (usedDependencies.contains(fileName.absolutePath)) - continue; - - if (fileName.absolutePath.endsWith(".so"_L1)) { - if (!readDependenciesFromElf(options, fileName.absolutePath, &usedDependencies, - &remainingDependencies)) { - fprintf(stdout, "Skipping file dependency: %s\n", - qPrintable(fileName.relativePath)); - continue; - } - } - usedDependencies.insert(fileName.absolutePath); - - if (options->verbose) { - fprintf(stdout, "Appending file dependency: %s\n", qPrintable(fileName.relativePath)); - } - - options->qtDependencies[options->currentArchitecture].append(fileName); - } -} - bool readAndroidDependencyXml(Options *options, const QString &moduleName, QSet<QString> *usedDependencies, @@ -1945,15 +1913,29 @@ bool readAndroidDependencyXml(Options *options, QString file = reader.attributes().value("file"_L1).toString(); - if (reader.attributes().hasAttribute("type"_L1) - && reader.attributes().value("type"_L1) == "plugin_dir"_L1 - && !options->androidDeployPlugins.isEmpty()) { - continue; - } - const QList<QtDependency> fileNames = findFilesRecursively(*options, file); - readDependenciesFromFiles(options, fileNames, *usedDependencies, - *remainingDependencies); + + for (const QtDependency &fileName : fileNames) { + if (usedDependencies->contains(fileName.absolutePath)) + continue; + + if (fileName.absolutePath.endsWith(".so"_L1)) { + QSet<QString> remainingDependencies; + if (!readDependenciesFromElf(options, fileName.absolutePath, + usedDependencies, + &remainingDependencies)) { + fprintf(stdout, "Skipping dependencies from xml: %s\n", + qPrintable(fileName.relativePath)); + continue; + } + } + usedDependencies->insert(fileName.absolutePath); + + if (options->verbose) + fprintf(stdout, "Appending dependency from xml: %s\n", qPrintable(fileName.relativePath)); + + options->qtDependencies[options->currentArchitecture].append(fileName); + } } else if (reader.name() == "jar"_L1) { int bundling = reader.attributes().value("bundling"_L1).toInt(); QString fileName = QDir::cleanPath(reader.attributes().value("file"_L1).toString()); @@ -2430,14 +2412,6 @@ bool readDependencies(Options *options) if (!readDependenciesFromElf(options, "%1/libs/%2/lib%3_%2.so"_L1.arg(options->outputDirectory, options->currentArchitecture, options->applicationBinary), &usedDependencies, &remainingDependencies)) return false; - QList<QtDependency> pluginDeps; - for (const auto &pluginPath : options->androidDeployPlugins) { - pluginDeps.append(findFilesRecursively(*options, QFileInfo(pluginPath), - options->qtInstallDirectory + "/"_L1)); - } - - readDependenciesFromFiles(options, pluginDeps, usedDependencies, remainingDependencies); - while (!remainingDependencies.isEmpty()) { QSet<QString>::iterator start = remainingDependencies.begin(); QString fileName = absoluteFilePath(options, *start); |