mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Add generate_apk=yes to generate an APK after building
This is useful to speed up iteration when working on the engine (or editor). This can be combined with a script that calls `adb` to deploy the APK on a device (coupled with Godot's `--export-*` for projects) to further speed up iteration.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import subprocess
|
||||
|
||||
Import("env")
|
||||
|
||||
android_files = [
|
||||
@@ -77,3 +79,29 @@ if lib_arch_dir != "":
|
||||
str(env["ANDROID_NDK_ROOT"]) + "/sources/cxx-stl/llvm-libc++/libs/" + lib_arch_dir + "/libc++_shared.so"
|
||||
)
|
||||
env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE"))
|
||||
|
||||
def generate_apk(target, source, env):
|
||||
if env["target"] != "editor" and env["dev_build"]:
|
||||
subprocess.run(
|
||||
[
|
||||
"./gradlew",
|
||||
"generateDevTemplate",
|
||||
"--quiet",
|
||||
],
|
||||
cwd="platform/android/java",
|
||||
)
|
||||
else:
|
||||
# Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task.
|
||||
subprocess.run(
|
||||
[
|
||||
"./gradlew",
|
||||
"generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates",
|
||||
"--quiet",
|
||||
],
|
||||
cwd="platform/android/java",
|
||||
)
|
||||
|
||||
if env["generate_apk"]:
|
||||
generate_apk_command = env_android.Command("generate_apk", [], generate_apk)
|
||||
command = env_android.AlwaysBuild(generate_apk_command)
|
||||
env_android.Depends(command, [lib])
|
||||
|
||||
Reference in New Issue
Block a user