22 lines
667 B
GDScript
22 lines
667 B
GDScript
@tool
|
|
extends EditorPlugin
|
|
|
|
class BuildStamp extends EditorExportPlugin:
|
|
func _get_name() -> String:
|
|
return "DemonBuildIdentity"
|
|
|
|
func _export_begin(_features: PackedStringArray, _debug: bool, _path: String, _flags: int) -> void:
|
|
var id="0.19-"+Crypto.new().generate_random_bytes(12).hex_encode()
|
|
var stamp={"version":"0.19","id":id,"built_at_utc":Time.get_datetime_string_from_system(true)}
|
|
add_file("res://build_info.json",JSON.stringify(stamp).to_utf8_buffer(),false)
|
|
print("DEMON_BUILD_ID: "+id)
|
|
|
|
var exporter: BuildStamp
|
|
|
|
func _enter_tree():
|
|
exporter=BuildStamp.new()
|
|
add_export_plugin(exporter)
|
|
|
|
func _exit_tree():
|
|
remove_export_plugin(exporter)
|