diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-07-21 14:34:23 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-08 08:49:36 +0000 |
commit | b8aa317bb17f2c7df4b6ee06a8a04a9cc191f22c (patch) | |
tree | ab640649d388d1d2d8c8ebcdd0912c837b08e114 | |
parent | d5eaa509a074155cd24cd2715749a180b7bc5f10 (diff) |
winrtrunner: Fix deployment of QtQuick applications when using appx
For remote devices winrtrunner needs to create an appx package for
deployment. While creating that package a file extension list has been
used to identify potential files by Qt which need to be deployed.
This was broken for Qt Quick Controls applications, but also for
projects using for instance jpeg image files.
Instead, switch to an exclusion list of file extensions we can be sure
should not be part of the package. In the worst case the package is too
big when deployed with winrtrunner, but will not cause runtime errors
anymore.
Change-Id: Ief6d4aaf9bc0933b32734feacbef170dcc8ab945
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/winrtrunner/appxengine.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/winrtrunner/appxengine.cpp b/src/winrtrunner/appxengine.cpp index dfdd7d0db..d8322d1ca 100644 --- a/src/winrtrunner/appxengine.cpp +++ b/src/winrtrunner/appxengine.cpp @@ -668,14 +668,19 @@ bool AppxEngine::createPackage(const QString &packageFileName) qCWarning(lcWinRtRunner) << "No mapping file exists. Only recognized files will be packaged."; // Add executable files.insert(QDir::toNativeSeparators(d->executable), QFileInfo(d->executable).fileName()); - // Add potential Qt files - const QStringList fileTypes = QStringList() - << QStringLiteral("*.dll") << QStringLiteral("*.png") << QStringLiteral("*.qm") - << QStringLiteral("*.qml") << QStringLiteral("*.qmldir"); - QDirIterator dirIterator(base.absolutePath(), fileTypes, QDir::Files, QDirIterator::Subdirectories); + // Add all files but filtered artifacts + const QStringList excludeFileTypes = QStringList() + << QStringLiteral("ilk") << QStringLiteral("pdb") << QStringLiteral("obj") + << QStringLiteral("appx"); + + QDirIterator dirIterator(base.absolutePath(), QDir::Files, QDirIterator::Subdirectories); while (dirIterator.hasNext()) { const QString filePath = dirIterator.next(); - files.insert(QDir::toNativeSeparators(filePath), QDir::toNativeSeparators(base.relativeFilePath(filePath))); + if (filePath.endsWith(QLatin1String("AppxManifest.xml"), Qt::CaseInsensitive)) + continue; + const QFileInfo fileInfo(filePath); + if (!excludeFileTypes.contains(fileInfo.suffix())) + files.insert(QDir::toNativeSeparators(filePath), QDir::toNativeSeparators(base.relativeFilePath(filePath))); } } |