added fix for android build on windows

This commit is contained in:
Travis Lange 2024-04-29 20:32:41 -04:00
parent 4728ff30c0
commit cc0d5a43cc
1 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys
import subprocess import subprocess
Import("env") Import("env")
@ -81,10 +82,21 @@ if lib_arch_dir != "":
env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE")) env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE"))
def generate_apk(target, source, env): 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"]: if env["target"] != "editor" and env["dev_build"]:
subprocess.run( subprocess.run(
[ gradle_process
"./gradlew", + [
"generateDevTemplate", "generateDevTemplate",
"--quiet", "--quiet",
], ],
@ -93,8 +105,8 @@ if lib_arch_dir != "":
else: else:
# Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task. # Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task.
subprocess.run( subprocess.run(
[ gradle_process
"./gradlew", + [
"generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates", "generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates",
"--quiet", "--quiet",
], ],