Skip to content

Commit

Permalink
Android: handle quotes in hard-coded namespace in build.gradle
Browse files Browse the repository at this point in the history
Remove quotes from the namespace values if they're set
directly to build.gradle.

Fixes: QTBUG-132150
Change-Id: I7f5e132c2600bf5079850c99dc500b1dff7e6a96
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 60f7821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 440dcac)
  • Loading branch information
Issam-b authored and Qt Cherry-pick Bot committed Dec 15, 2024
1 parent 933128d commit 29a793f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tools/androiddeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,14 @@ GradleBuildConfigs gradleBuildConfigs(const QString &path)
} else if (trimmedLine.contains("compileSdkVersion androidCompileSdkVersion.toInteger()")) {
configs.usesIntegerCompileSdkVersion = true;
} else if (trimmedLine.contains("namespace")) {
configs.appNamespace = QString::fromUtf8(extractValue(trimmedLine));
const QString value = QString::fromUtf8(extractValue(trimmedLine));
const bool singleQuoted = value.startsWith(u'\'') && value.endsWith(u'\'');
const bool doubleQuoted = value.startsWith(u'\"') && value.endsWith(u'\"');

if (singleQuoted || doubleQuoted)
configs.appNamespace = value.mid(1, value.length() - 2);
else
configs.appNamespace = value;
}
}

Expand Down

0 comments on commit 29a793f

Please sign in to comment.