From 118d8729ca64d47987a83a3a4b69e09b03549622 Mon Sep 17 00:00:00 2001 From: Daylily-Zeleen <735170336@qq.com> Date: Wed, 10 Apr 2024 17:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8gdextension=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- SConstruct | 17 +++++++++++++++++ .../gddragonbones/gddragonbones.gdextension | 10 ++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index eeaba95..782cfe1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ project/ build/ # scons -bin/ \ No newline at end of file +bin/ +__pycache__/ \ No newline at end of file diff --git a/SConstruct b/SConstruct index 3099827..14d1d67 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,7 @@ #!/usr/bin/env python import os import shutil +import version env = SConscript("godot-cpp/SConstruct") lib_name = "libgddragonbones" @@ -21,6 +22,8 @@ output_bin_folder = "./bin" plugin_folder = "./demo/addons/gddragonbones" plugin_bin_folder = f"{plugin_folder}/bin" +extension_file = "demo/addons/gddragonbones/gddragonbones.gdextension" + if env.debug_features: env.Append(CPPDEFINES=["TOOLS_ENABLED"]) @@ -96,6 +99,20 @@ def on_complete(target, source, env): copy_file("README.md", os.path.join(plugin_folder, "README.md")) copy_file("LICENSE", os.path.join(plugin_folder, "LICENSE")) + # 更新.gdextension中的版本信息 + f = open(extension_file, "r", encoding="utf8") + lines = f.readlines() + f.close() + + for i in range(len(lines)): + if lines[i].startswith('version = "') and lines[i].endswith('"\n'): + lines[i] = f'version = "{version.version}"\n' + break + + f = open(extension_file, "w", encoding="utf8") + f.writelines(lines) + f.close() + # Disable scons cache for source files NoCache(sources) diff --git a/demo/addons/gddragonbones/gddragonbones.gdextension b/demo/addons/gddragonbones/gddragonbones.gdextension index efe4cea..48c4047 100644 --- a/demo/addons/gddragonbones/gddragonbones.gdextension +++ b/demo/addons/gddragonbones/gddragonbones.gdextension @@ -1,3 +1,13 @@ +[infomation] +name = "Godot-DragonBones" +version = "v0.0.0" +decription = "A DragonBones plugin for Godot." +author = "忘忧の (Daylily Zeleen)" +email = "daylily-zeleen@foxmail.com" +support_link = "https://afdian.net/a/Daylily-Zeleen" +repo = "https://github.com/Daylily-Zeleen/Godot-DragonBones" +others = "诚接Godot游戏开发,欢迎邮件联系。/ Receive game development outsourcing, welcome to contact by email." + [configuration] entry_symbol = "gddragonbones_library_init"