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 <jani.heikkinen@qt.io>
(cherry picked from commit de62bb90ec829bd88fa91c48c4061d61cb1f6a71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 219a0aabc118916c3be16e647a2a1411805cb15a)
This commit is contained in:
Alexey Edelev 2024-01-29 13:27:28 +00:00 committed by Qt Cherry-pick Bot
parent 498658b72e
commit 9e6dbdb4fc
3 changed files with 24 additions and 55 deletions

View File

@ -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()

View File

@ -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

View File

@ -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;
@ -1012,11 +1011,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());
@ -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);