summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2013-10-18 16:33:49 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-23 12:47:30 +0200
commitad05d1f675ff14beb694f1664d8a2ad4378d5f9e (patch)
tree14e36a5022087784a1fd9297aa5dc756043583e3
parent8b4a2fbeec302f035274de1b6c262358e97a1f83 (diff)
Smarter plugins resolver.
Don't copy plugins with unmet dependencies. Change-Id: I6e84166fac5e5553bf3d5b87982eba8255160ae7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r--src/androiddeployqt/main.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index e798a0c79..6bfd95ed9 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -1045,10 +1045,6 @@ bool readAndroidDependencyXml(Options *options,
continue;
usedDependencies->insert(fileName);
- if (fileName.endsWith(QLatin1String(".so"))) {
- remainingDependencies->insert(fileName);
- }
-
options->qtDependencies.append(fileName);
}
} else if (reader.name() == QLatin1String("jar")) {
@@ -1080,6 +1076,9 @@ bool readAndroidDependencyXml(Options *options,
} else if (!fileName.isEmpty()) {
options->localLibs.append(fileName);
}
+ if (fileName.endsWith(QLatin1String(".so"))) {
+ remainingDependencies->insert(fileName);
+ }
}
}
}
@@ -1365,6 +1364,18 @@ bool fetchRemoteModifications(Options *options, const QString &directory)
return true;
}
+bool goodToCopy(const Options *options, const QString &file)
+{
+ if (!file.endsWith(QLatin1String(".so")))
+ return true;
+
+ foreach (const QString &lib, getQtLibsFromElf(*options, file))
+ if (!options->qtDependencies.contains(lib))
+ return false;
+
+ return true;
+}
+
bool deployToLocalTmp(Options *options,
const QString &qtDependency)
{
@@ -1373,6 +1384,12 @@ bool deployToLocalTmp(Options *options,
QFileInfo fileInfo(options->qtInstallDirectory + QLatin1Char('/') + qtDependency);
+ if (!goodToCopy(options, fileInfo.absoluteFilePath())) {
+ if (options->verbose)
+ fprintf(stderr, " -- Skipping %s. It has unmet dependencies.\n", qPrintable(fileInfo.absoluteFilePath()));
+ return true;
+ }
+
// Make sure precision is the same as what we get from Android
QDateTime sourceModified = QDateTime::fromTime_t(fileInfo.lastModified().toTime_t());
@@ -1468,6 +1485,12 @@ bool copyQtFiles(Options *options)
return false;
}
+ if (!goodToCopy(options, sourceFileName)) {
+ if (options->verbose)
+ fprintf(stderr, " -- Skipping %s. It has unmet dependencies.\n", qPrintable(sourceFileName));
+ continue;
+ }
+
if (options->deploymentMechanism == Options::Bundled
&& !copyFileIfNewer(sourceFileName,
options->outputDirectory + QLatin1Char('/') + destinationFileName,