From 0448d4e26eeb475e380c083169117dfc6cbef6a0 Mon Sep 17 00:00:00 2001 From: ne0fhyk Date: Tue, 21 Dec 2021 07:41:12 -0800 Subject: [PATCH] Fix Android Studio builds. (cherry picked from commit 1345e6693564cb57abd6e471e5e5a14a4950081b) --- platform/android/java/build.gradle | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle index efdcc6c77b5..ac008edbedb 100644 --- a/platform/android/java/build.gradle +++ b/platform/android/java/build.gradle @@ -124,8 +124,11 @@ task zipCustomBuild(type: Zip) { def templateExcludedBuildTask() { // We exclude these gradle tasks so we can run the scons command manually. def excludedTasks = [] - for (String buildType : supportedTargets) { - excludedTasks += ":lib:" + getSconsTaskName(buildType) + if (!isAndroidStudio()) { + logger.lifecycle("Excluding Android studio build tasks") + for (String buildType : supportedTargets) { + excludedTasks += ":lib:" + getSconsTaskName(buildType) + } } return excludedTasks } @@ -155,6 +158,11 @@ def templateBuildTasks() { return tasks } +def isAndroidStudio() { + def sysProps = System.getProperties() + return sysProps != null && sysProps['idea.platform.prefix'] != null +} + /** * Master task used to coordinate the tasks defined above to generate the set of Godot templates. */