From e59f3100615e5ca52530f284a98d01627b826fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tinja=20Paavosepp=C3=A4?= Date: Wed, 8 May 2024 13:55:35 +0300 Subject: [PATCH] androiddeployqt: Add a placeholder for plugin type in build.gradle This allows to later change the plugin type based on the options provided for the androiddeployqt, such as when building an AAR. Task-number: QTBUG-116955 Task-number: QTBUG-65567 Change-Id: I6314c8ab9edccbf953ae48543d5a002a9f807581 Reviewed-by: Assam Boudjelthia --- src/android/templates/build.gradle | 3 ++- src/tools/androiddeployqt/main.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index de37b5ea6ba..a104687f4e0 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -14,7 +14,7 @@ repositories { mavenCentral() } -apply plugin: 'com.android.application' +apply plugin: qtGradlePluginType dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) @@ -29,6 +29,7 @@ android { * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. + * - qtGradlePluginType - whether to build an app or a library * * are defined in gradle.properties file. This file is * updated by QtCreator and androiddeployqt tools. diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 831b1361ce3..cbe6336c975 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -2850,6 +2850,7 @@ bool buildAndroidProject(const Options &options) abiList.append(it.key()); } gradleProperties["qtTargetAbiList"] = abiList.toLocal8Bit();// armeabi-v7a or arm64-v8a or ... + gradleProperties["qtGradlePluginType"] = "com.android.application"; if (!mergeGradleProperties(gradlePropertiesPath, gradleProperties)) return false;