summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-01-06 09:43:19 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-01-06 11:32:25 +0100
commit9830f251fee207be04764d627c7a8a4902f7beaf (patch)
treee6c9f8094eeb3177fdd69cf8cb80f9a9d0cbfec0
parent21b379da4fbe878b508594e6d4faf1b0572b52fd (diff)
androiddeployqt: Don't bundle QML files in project
Sometimes qmlimportscanner will generate dependencies on files local to the QML root path. This happens specifically when you have an import "../" in one of your files. Since the files in the input project are already installed in some way, we don't need to include them under assets, so we skip these files. [ChangeLog][Android] Fixed bug where androiddeployqt would automatically bundle some QML files in your input project along with their dependencies. Change-Id: I186df8213024100e5e9ee862eadb3ca568fa6dea Task-number: QTBUG-43573 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
-rw-r--r--src/androiddeployqt/main.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index 925f2c5b7..483f75d31 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -1656,11 +1656,16 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
QString rootPath = options->rootPath;
if (rootPath.isEmpty())
- rootPath = QFileInfo(options->inputFileName).path();
+ rootPath = QFileInfo(options->inputFileName).absolutePath();
+ else
+ rootPath = QFileInfo(rootPath).absoluteFilePath();
+
+ if (!rootPath.endsWith(QLatin1Char('/')))
+ rootPath += QLatin1Char('/');
QStringList importPaths;
importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml"));
- importPaths += QFileInfo(rootPath).absoluteFilePath();
+ importPaths += rootPath;
foreach (QString qmlImportPath, options->qmlImportPaths)
importPaths += shellQuote(qmlImportPath);
@@ -1713,6 +1718,16 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
continue;
}
+ QString absolutePath = info.absolutePath();
+ if (!absolutePath.endsWith(QLatin1Char('/')))
+ absolutePath += QLatin1Char('/');
+
+ if (absolutePath.startsWith(rootPath)) {
+ if (options->verbose)
+ fprintf(stdout, " -- Skipping because file is in QML root path.\n");
+ continue;
+ }
+
QString importPathOfThisImport;
foreach (QString importPath, importPaths) {
#if defined(Q_OS_WIN32)