Skip to content

Commit 9824a90

Browse files
committed
Merge pull request godotengine#91339 from TCROC/windows-apk-build-fix
Fix for Android build on Windows
2 parents 9ff72fa + cc0d5a4 commit 9824a90

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

platform/android/SCsub

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import sys
34
import subprocess
45
from methods import print_warning
56

@@ -82,10 +83,21 @@ if lib_arch_dir != "":
8283
env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE"))
8384

8485
def generate_apk(target, source, env):
86+
gradle_process = []
87+
88+
if sys.platform.startswith("win"):
89+
gradle_process = [
90+
"cmd",
91+
"/c",
92+
"gradlew.bat",
93+
]
94+
else:
95+
gradle_process = ["./gradlew"]
96+
8597
if env["target"] != "editor" and env["dev_build"]:
8698
subprocess.run(
87-
[
88-
"./gradlew",
99+
gradle_process
100+
+ [
89101
"generateDevTemplate",
90102
"--quiet",
91103
],
@@ -94,8 +106,8 @@ if lib_arch_dir != "":
94106
else:
95107
# Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task.
96108
subprocess.run(
97-
[
98-
"./gradlew",
109+
gradle_process
110+
+ [
99111
"generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates",
100112
"--quiet",
101113
],

0 commit comments

Comments
 (0)