summaryrefslogtreecommitdiffstats
path: root/src/tools/androiddeployqt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/androiddeployqt/main.cpp')
-rw-r--r--src/tools/androiddeployqt/main.cpp59
1 files changed, 16 insertions, 43 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index ac48acb34d..438845c862 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -1813,7 +1813,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
qPrintable(object.value(QLatin1String("name")).toString()));
} else {
if (options->verbose)
- fprintf(stdout, " -- Adding '%s' as QML dependency\n", qPrintable(path));
+ fprintf(stdout, " -- Adding '%s' as QML dependency\n", path.toLocal8Bit().constData());
QFileInfo info(path);
@@ -1853,57 +1853,30 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
return false;
}
- importPathOfThisImport = QDir(importPathOfThisImport).absolutePath() + QLatin1Char('/');
- QList<QtDependency> qmlImportsDependencies;
- auto collectQmlDependency = [&usedDependencies, &qmlImportsDependencies,
- &importPathOfThisImport](const QString &filePath) {
- if (!usedDependencies->contains(filePath)) {
- usedDependencies->insert(filePath);
- qmlImportsDependencies += QtDependency(
- QLatin1String("qml/") + filePath.mid(importPathOfThisImport.size()),
- filePath);
- }
- };
-
-
QDir dir(importPathOfThisImport);
importPathOfThisImport = dir.absolutePath() + QLatin1Char('/');
const QList<QtDependency> fileNames = findFilesRecursively(*options, info, importPathOfThisImport);
for (QtDependency fileName : fileNames) {
- if (!usedDependencies->contains(fileName.absolutePath) && fileName.absolutePath.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName.absolutePath)) {
- QSet<QString> remainingDependencies;
- if (readDependenciesFromElf(options, fileName.absolutePath, usedDependencies, &remainingDependencies))
- collectQmlDependency(fileName.absolutePath);
- }
- }
-
- QFileInfo qmldirFileInfo = QFileInfo(path + QLatin1Char('/') + QLatin1String("qmldir"));
- if (qmldirFileInfo.exists()) {
- collectQmlDependency(qmldirFileInfo.absoluteFilePath());
- }
+ if (usedDependencies->contains(fileName.absolutePath))
+ continue;
- QVariantList qmlFiles =
- object.value(QLatin1String("components")).toArray().toVariantList();
- qmlFiles.append(object.value(QLatin1String("scripts")).toArray().toVariantList());
- bool qmlFilesMissing = false;
- for (const auto &qmlFileEntry : qmlFiles) {
- QFileInfo fileInfo(qmlFileEntry.toString());
- if (!fileInfo.exists()) {
- qmlFilesMissing = true;
- break;
- }
- collectQmlDependency(fileInfo.absoluteFilePath());
- }
+ usedDependencies->insert(fileName.absolutePath);
- if (qmlFilesMissing) {
if (options->verbose)
- fprintf(stdout,
- " -- Skipping because the required qml files are missing.\n");
- continue;
- }
+ fprintf(stdout, " -- Appending dependency found by qmlimportscanner: %s\n", qPrintable(fileName.absolutePath));
+
+ // Put all imports in default import path in assets
+ fileName.relativePath.prepend(QLatin1String("qml/"));
+ options->qtDependencies[options->currentArchitecture].append(fileName);
- options->qtDependencies[options->currentArchitecture].append(qmlImportsDependencies);
+ if (fileName.absolutePath.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName.absolutePath)) {
+ QSet<QString> remainingDependencies;
+ if (!readDependenciesFromElf(options, fileName.absolutePath, usedDependencies, &remainingDependencies))
+ return false;
+
+ }
+ }
}
}