summaryrefslogtreecommitdiffstats
path: root/src/tools/androiddeployqt
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-25 01:00:25 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-25 11:30:04 +0100
commit58c69df4d38324644bc49ec5f42ee8343a454b2d (patch)
treede0a1ce603292dcaff134d4e1e8ab064295515a2 /src/tools/androiddeployqt
parent03b1d2c44940322208c12c7bceee376b51d8e852 (diff)
parent59a705e3710b0ba93bb698e3223241cfac932948 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
Diffstat (limited to 'src/tools/androiddeployqt')
-rw-r--r--src/tools/androiddeployqt/main.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index a057aede5b..aa8c91865e 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -165,6 +165,7 @@ struct Options
QString applicationBinary;
QString rootPath;
QStringList qmlImportPaths;
+ QStringList qrcFiles;
// Versioning
QString versionName;
@@ -992,7 +993,10 @@ bool readInputFile(Options *options)
}
}
}
-
+ {
+ const QJsonValue qrcFiles = jsonObject.value(QLatin1String("qrcFiles"));
+ options->qrcFiles = qrcFiles.toString().split(QLatin1Char(','), QString::SkipEmptyParts);
+ }
options->packageName = packageNameFromAndroidManifest(options->androidSourceDirectory + QLatin1String("/AndroidManifest.xml"));
if (options->packageName.isEmpty())
options->packageName = cleanPackageName(QLatin1String("org.qtproject.example.%1").arg(options->applicationBinary));
@@ -1730,22 +1734,28 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
}
QString rootPath = options->rootPath;
- if (rootPath.isEmpty())
- rootPath = QFileInfo(options->inputFileName).absolutePath();
- else
- rootPath = QFileInfo(rootPath).absoluteFilePath();
+ if (!options->qrcFiles.isEmpty()) {
+ qmlImportScanner += QLatin1String(" -qrcFiles");
+ for (const QString &qrcFile : options->qrcFiles)
+ qmlImportScanner += QLatin1Char(' ') + shellQuote(qrcFile);
+ } else {
+ if (rootPath.isEmpty())
+ rootPath = QFileInfo(options->inputFileName).absolutePath();
+ else
+ rootPath = QFileInfo(rootPath).absoluteFilePath();
- if (!rootPath.endsWith(QLatin1Char('/')))
- rootPath += QLatin1Char('/');
+ if (!rootPath.endsWith(QLatin1Char('/')))
+ rootPath += QLatin1Char('/');
+ qmlImportScanner += QLatin1String(" -rootPath %1").arg(shellQuote(rootPath));
+ }
QStringList importPaths;
importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml"));
- importPaths += shellQuote(rootPath);
+ if (!rootPath.isEmpty())
+ importPaths += shellQuote(rootPath);
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths))
importPaths += shellQuote(qmlImportPath);
-
- qmlImportScanner += QLatin1String(" -rootPath %1 -importPath %2")
- .arg(shellQuote(rootPath), importPaths.join(QLatin1Char(' ')));
+ qmlImportScanner += QLatin1String(" -importPath %1").arg(importPaths.join(QLatin1Char(' ')));
if (options->verbose) {
fprintf(stdout, "Running qmlimportscanner with the following command: %s\n",
@@ -1967,7 +1977,8 @@ bool readDependencies(Options *options)
}
}
- if (!options->rootPath.isEmpty() && !scanImports(options, &usedDependencies))
+ if ((!options->rootPath.isEmpty() || options->qrcFiles.isEmpty()) &&
+ !scanImports(options, &usedDependencies))
return false;
return true;