From c6c364d0cae8b09e23921e942f65013bad0b7ff1 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 2 Oct 2014 13:02:46 +0200 Subject: Android: Support recursive ANDROID_DEPLOYMENT_DEPENDENCIES The convenience of ANDROID_DEPLOYMENT_DEPENDENCIES would be greatly increased if you could include a directory and have its contents be added recursively to the deployment, instead of listing each file individually. Change-Id: I3cf3248007369122ea6ba98ab79f7f2f951a26c3 Task-number: QTBUG-41674 Reviewed-by: Paul Olav Tvete --- src/androiddeployqt/main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index e91ae494..3696038f 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -741,8 +741,23 @@ bool readInputFile(Options *options) QJsonValue deploymentDependencies = jsonObject.value("deployment-dependencies"); if (!deploymentDependencies.isUndefined()) { QStringList dependencies = deploymentDependencies.toString().split(QLatin1Char(',')); - foreach (QString dependency, dependencies) - options->qtDependencies.append(QtDependency(dependency, options->qtInstallDirectory + QLatin1Char('/') + dependency)); + foreach (QString dependency, dependencies) { + QString path = options->qtInstallDirectory + QLatin1Char('/') + dependency; + if (QFileInfo(path).isDir()) { + QDirIterator iterator(path, QDirIterator::Subdirectories); + while (iterator.hasNext()) { + if (iterator.fileInfo().isFile()) { + QString subPath = iterator.filePath(); + options->qtDependencies.append(QtDependency(subPath.mid(options->qtInstallDirectory.length() + 1), + subPath)); + } + + iterator.next(); + } + } else { + options->qtDependencies.append(QtDependency(dependency, path)); + } + } } } -- cgit v1.2.3