From 95ef19371577e1646bd232763928e6ddf80d753f Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Tue, 28 Sep 2021 09:58:44 +0200 Subject: [PATCH] Rename variable to not reference Qt5 In the Android gradle files, the variable qt5AndroidDir refers to Qt5 and might confuse users. This patch renames to qtAndroidDir. Pick-to: 6.2 Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5 Reviewed-by: Assam Boudjelthia --- src/android/templates/build.gradle | 8 ++++---- src/tools/androiddeployqt/main.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index 310b7106be..fd7ce34aa9 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -25,7 +25,7 @@ android { * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion - * - qt5AndroidDir - holds the path to qt android files + * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * @@ -41,9 +41,9 @@ android { sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] - aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] - res.srcDirs = [qt5AndroidDir + '/res', 'res'] + java.srcDirs = [qtAndroidDir + '/src', 'src', 'java'] + aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] + res.srcDirs = [qtAndroidDir + '/res', 'res'] resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index e0e1e2c8bc..1d314099a2 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -2550,6 +2550,10 @@ bool buildAndroidProject(const Options &options) GradleProperties gradleProperties = readGradleProperties(gradlePropertiesPath); gradleProperties["android.bundle.enableUncompressedNativeLibs"] = "false"; gradleProperties["buildDir"] = "build"; + gradleProperties["qtAndroidDir"] = (options.qtInstallDirectory + QLatin1String("/src/android/java")).toUtf8(); + // The following property "qt5AndroidDir" is only for compatibility. + // Projects using a custom build.gradle file may use this variable. + // ### Qt7: Remove the following line gradleProperties["qt5AndroidDir"] = (options.qtInstallDirectory + QLatin1String("/src/android/java")).toUtf8(); gradleProperties["androidCompileSdkVersion"] = options.androidPlatform.split(QLatin1Char('-')).last().toLocal8Bit(); gradleProperties["qtMinSdkVersion"] = options.minSdkVersion;