summaryrefslogtreecommitdiffstats
path: root/src/tools/androiddeployqt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/androiddeployqt/main.cpp')
-rw-r--r--src/tools/androiddeployqt/main.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 550ed0832f..aa8c91865e 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -128,6 +128,7 @@ struct Options
, jarSigner(false)
, installApk(false)
, uninstallApk(false)
+ , qmlImportScannerBinaryPath()
{}
enum DeploymentMechanism
@@ -231,6 +232,9 @@ struct Options
QStringList initClasses;
QStringList permissions;
QStringList features;
+
+ // Override qml import scanner path
+ QString qmlImportScannerBinaryPath;
};
static const QHash<QByteArray, QByteArray> elfArchitecures = {
@@ -522,6 +526,8 @@ Options parseOptions()
options.jarSigner = true;
} else if (argument.compare(QLatin1String("--aux-mode"), Qt::CaseInsensitive) == 0) {
options.auxMode = true;
+ } else if (argument.compare(QLatin1String("--qml-importscanner-binary"), Qt::CaseInsensitive) == 0) {
+ options.qmlImportScannerBinaryPath = arguments.at(++i).trimmed();
}
}
@@ -605,6 +611,10 @@ void printHelp()
" dependencies into the build directory and update the XML templates.\n"
" The project will not be built or installed.\n"
" --apk <path/where/to/copy/the/apk>: Path where to copy the built apk.\n"
+ " --qml-importscanner-binary <path/to/qmlimportscanner>: Override the\n"
+ " default qmlimportscanner binary path. By default the\n"
+ " qmlimportscanner binary is located using the Qt directory\n"
+ " specified in the input file.\n"
" --help: Displays this information.\n\n",
qPrintable(QCoreApplication::arguments().at(0))
);
@@ -926,6 +936,12 @@ bool readInputFile(Options *options)
}
{
+ const QJsonValue qmlImportScannerBinaryPath = jsonObject.value(QLatin1String("qml-importscanner-binary"));
+ if (!qmlImportScannerBinaryPath.isUndefined())
+ options->qmlImportScannerBinaryPath = qmlImportScannerBinaryPath.toString();
+ }
+
+ {
const QJsonValue applicationBinary = jsonObject.value(QLatin1String("application-binary"));
if (applicationBinary.isUndefined()) {
fprintf(stderr, "No application binary defined in json file.\n");
@@ -1702,10 +1718,15 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
if (options->verbose)
fprintf(stdout, "Scanning for QML imports.\n");
- QString qmlImportScanner = options->qtInstallDirectory + QLatin1String("/bin/qmlimportscanner");
+ QString qmlImportScanner;
+ if (!options->qmlImportScannerBinaryPath.isEmpty()) {
+ qmlImportScanner = options->qmlImportScannerBinaryPath;
+ } else {
+ options->qtInstallDirectory + QLatin1String("/bin/qmlimportscanner");
#if defined(Q_OS_WIN32)
- qmlImportScanner += QLatin1String(".exe");
+ qmlImportScanner += QLatin1String(".exe");
#endif
+ }
if (!QFile::exists(qmlImportScanner)) {
fprintf(stderr, "qmlimportscanner not found: %s\n", qPrintable(qmlImportScanner));