From cc0d5a43cc8b91b9965a2078bfcc60363e029288 Mon Sep 17 00:00:00 2001 From: Travis Lange Date: Mon, 29 Apr 2024 20:32:41 -0400 Subject: [PATCH] added fix for android build on windows --- platform/android/SCsub | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/platform/android/SCsub b/platform/android/SCsub index 31bc7c25b044..c4d126830193 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -1,5 +1,6 @@ #!/usr/bin/env python +import sys import subprocess Import("env") @@ -81,10 +82,21 @@ if lib_arch_dir != "": env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE")) def generate_apk(target, source, env): + gradle_process = [] + + if sys.platform.startswith("win"): + gradle_process = [ + "cmd", + "/c", + "gradlew.bat", + ] + else: + gradle_process = ["./gradlew"] + if env["target"] != "editor" and env["dev_build"]: subprocess.run( - [ - "./gradlew", + gradle_process + + [ "generateDevTemplate", "--quiet", ], @@ -93,8 +105,8 @@ if lib_arch_dir != "": else: # Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task. subprocess.run( - [ - "./gradlew", + gradle_process + + [ "generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates", "--quiet", ],