2024-07-14 08:54:08 -07:00
|
|
|
@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")
|
|
|
|
|
2024-07-14 10:23:19 -07:00
|
|
|
# TODO: Other platforms (macos)
|
|
|
|
|
2024-07-14 08:54:08 -07:00
|
|
|
for platform in platform_list:
|
|
|
|
for arch in arch_list:
|
2024-07-14 10:23:19 -07:00
|
|
|
var archive_to_export = build_wrangler._detect_archive_for_build(platform, arch)
|
2024-07-14 08:54:08 -07:00
|
|
|
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)
|