summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoody Liu <mooodyhunter@outlook.com>2022-05-18 01:17:56 +0100
committerMoody Liu <mooodyhunter@outlook.com>2022-06-28 17:06:33 +0100
commit8a96c8a22ca2c81969bb5e06249c06143b7f8249 (patch)
treef23603b5b9143cf8e7a2440b179773c885231d2f
parentAvoid overflowing coverage in rasterizer (diff)
downloadqtbase-8a96c8a22ca2c81969bb5e06249c06143b7f8249.tar.xz
qtbase-8a96c8a22ca2c81969bb5e06249c06143b7f8249.zip
fix androiddeployqt with user application with in-tree QML modules
when deploying user applications with QML modules located under user's subdirectories, (e.g. some third-party QML components used as git submomdule). The qmldir for such QML modules will be, typically, generated under BUILD_DIR/android-qml. if a BUILD_DIR is under the source directory, androiddeployqt will skip those QML modules incorrectly because they "appeared to be under the QML root path so that seems can be imported", however without deploying them, it's impossible to import those modules on an Android device. this patch adds a check that also tests if a root path plus the module's url can actually lead to the correct module path, so a QML module under android-qml subdir would not pass the test, and thus won't be skipped. Task-number: QTBUG-103593 Pick-to: 6.4 6.3 Change-Id: I8af76bd38cd55700e17794cf2fff0e50a90ac87e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r--src/tools/androiddeployqt/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index f42bd86fae..3db00ad01f 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -1927,7 +1927,8 @@ bool readDependenciesFromElf(Options *options,
}
bool goodToCopy(const Options *options, const QString &file, QStringList *unmetDependencies);
-bool checkQmlFileInRootPaths(const Options *options, const QString &absolutePath);
+bool checkCanImportFromRootPaths(const Options *options, const QString &absolutePath,
+ const QUrl &moduleUrl);
bool scanImports(Options *options, QSet<QString> *usedDependencies)
{
@@ -2065,7 +2066,9 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
if (!absolutePath.endsWith(u'/'))
absolutePath += u'/';
- if (checkQmlFileInRootPaths(options, absolutePath)) {
+ const QUrl url(object.value("name"_L1).toString());
+
+ if (checkCanImportFromRootPaths(options, info.absolutePath(), url)) {
if (options->verbose)
fprintf(stdout, " -- Skipping because path is in QML root path.\n");
continue;
@@ -2157,10 +2160,12 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
return true;
}
-bool checkQmlFileInRootPaths(const Options *options, const QString &absolutePath)
+bool checkCanImportFromRootPaths(const Options *options, const QString &absolutePath,
+ const QUrl &moduleUrl)
{
+ const QString pathFromUrl = u"/"_s + moduleUrl.toString().replace(u'.', u'/');
for (auto rootPath : options->rootPaths) {
- if (absolutePath.startsWith(rootPath))
+ if ((rootPath + pathFromUrl) == absolutePath)
return true;
}
return false;