GodotPythonJSONRPC/addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd
2024-07-14 10:23:19 -07:00

31 lines
891 B
GDScript

@tool
extends EditorExportPlugin
class_name KiriPythonBuildExportPlugin
func _export_begin(
features : PackedStringArray, is_debug : bool,
path : String, flags : int):
print("features: ", features)
var build_wrangler : KiriPythonBuildWrangler = KiriPythonBuildWrangler.new()
var platform_list = []
var arch_list = []
if "linux" in features:
platform_list.append("Linux")
if "windows" in features:
platform_list.append("Windows")
if "x86_64" in features:
arch_list.append("x86_64")
# TODO: Other platforms (macos)
for platform in platform_list:
for arch in arch_list:
var archive_to_export = build_wrangler._detect_archive_for_build(platform, arch)
var file_contents : PackedByteArray = FileAccess.get_file_as_bytes(archive_to_export)
print("Adding file: ", archive_to_export, " ", len(file_contents))
add_file(archive_to_export, file_contents, false)