From: Eskil Abrahamsen Blomfeldt Date: Tue, 6 Jan 2015 08:43:19 +0000 (+0100) Subject: androiddeployqt: Don't bundle QML files in project X-Git-Tag: v5.4.1~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9830f251fee207be04764d627c7a8a4902f7beaf;p=platform%2Fupstream%2Fqttools.git 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 --- diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index 925f2c5..483f75d 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -1656,11 +1656,16 @@ bool scanImports(Options *options, QSet *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 *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)