From 1e9f8cead18be07dbda73847ca89908a4121b0f8 Mon Sep 17 00:00:00 2001 From: Michael Angelo Calimlim Date: Sun, 5 Nov 2023 13:26:25 +0800 Subject: [PATCH] add command to switch gdnlib entry between msvc and gnu --- Makefile.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile.toml b/Makefile.toml index 813b991..4870d97 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -206,6 +206,24 @@ mv -b *.keystore .. sed -i "s|keystore/release_password=\".*\"|keystore/release_password=\"${@}\"|g" ../godot/export_presets.cfg ''' +[tasks.switch-gdnlib-msvc-to-gnu-entry] +script_runner = "@shell" +script = ''' +sed -i "s|Windows.64=\"res://../lib/x86_64-pc-windows-msvc/{{project-name}}.dll\"|# Windows.64=\"res://../lib/x86_64-pc-windows-msvc/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|# Windows.64=\"res://../lib/x86_64-pc-windows-gnu/{{project-name}}.dll\"|Windows.64=\"res://../lib/x86_64-pc-windows-gnu/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|Windows.32=\"res://../lib/i686-pc-windows-msvc/{{project-name}}.dll\"|# Windows.32=\"res://../lib/i686-pc-windows-msvc/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|# Windows.32=\"res://../lib/i686-pc-windows-gnu/{{project-name}}.dll\"|Windows.32=\"res://../lib/i686-pc-windows-gnu/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +''' + +[tasks.switch-gdnlib-gnu-to-msvc-entry] +script_runner = "@shell" +script = ''' +sed -i "s|Windows.64=\"res://../lib/x86_64-pc-windows-gnu/{{project-name}}.dll\"|# Windows.64=\"res://../lib/x86_64-pc-windows-gnu/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|# Windows.64=\"res://../lib/x86_64-pc-windows-msvc/{{project-name}}.dll\"|Windows.64=\"res://../lib/x86_64-pc-windows-msvc/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|Windows.32=\"res://../lib/i686-pc-windows-gnu/{{project-name}}.dll\"|# Windows.32=\"res://../lib/i686-pc-windows-gnu/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +sed -i "s|# Windows.32=\"res://../lib/i686-pc-windows-msvc/{{project-name}}.dll\"|Windows.32=\"res://../lib/i686-pc-windows-msvc/{{project-name}}.dll\"|g" ../godot/native/game.gdnlib +''' + [tasks.doc] command = "cargo" args = ["doc", "--no-deps", "--open", "-v"]