From 7400294db48f677356eb573454eac6a613bc5817 Mon Sep 17 00:00:00 2001 From: GsLogimaker Date: Fri, 3 May 2024 11:24:05 -0500 Subject: [PATCH] Glecs GDExtension tweaks, rework VSCode launch and taks, update flecs-rs, unittests.yml --- .github/workflows/unittests.yml | 4 ++ .gitignore | 3 +- .vscode/launch.json | 41 +++++++++++++++++++++ .vscode/tasks.json | 51 ++++++++++++++++++++++++++ addons/glecs/glecs.gdextension | 20 +++++----- addons/glecs/glecs.gdextension.release | 17 +++++++++ addons/glecs/rust/flecs-rs | 2 +- 7 files changed, 127 insertions(+), 11 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 addons/glecs/glecs.gdextension.release diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index e50c491..d3bf094 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -28,6 +28,10 @@ jobs: --manifest-path \./addons/glecs/rust/glecs/Cargo.toml \ --features compile_bindings \ --target-dir ./addons/glecs/bin + cargo build --release --verbose \ + --manifest-path \./addons/glecs/rust/glecs/Cargo.toml \ + --features compile_bindings \ + --target-dir ./addons/glecs/bin - uses: croconut/godot-tester@v5.1 with: diff --git a/.gitignore b/.gitignore index e2328d2..482c985 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ addons/glecs/.vscode/settings.json .godot .gut_editor_config.json -addons/gut/gui/GutSceneTheme.tres \ No newline at end of file +addons/gut/gui/GutSceneTheme.tres +unittest_log.xml diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2c22688 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,41 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Game", + "preLaunchTask": "godot-rust: Build Debug", + "type": "lldb", + "request": "launch", + "program": "${config:godot-rust.environment.godotEditorPath}", + "cwd": "${config:godot-rust.environment.godotProjectPath}", + "presentation": { + "group": "Debug", + "order": 1 + } + }, + { + "name": "Release Game", + "preLaunchTask": "godot-rust: Build Release", + "type": "lldb", + "request": "launch", + "program": "${config:godot-rust.environment.godotEditorPath}", + "cwd": "${config:godot-rust.environment.godotProjectPath}", + "presentation": { + "group": "Debug", + "order": 2 + } + }, + { + "name": "Attach to Game", + "pid": "${command:pickMyProcess}", + "type": "lldb", + "request": "attach", + "program": "${config:godot-rust.environment.godotEditorPath}", + "port": 6007, + "presentation": { + "group": "Debug", + "order": 3 + } + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f4a6aa7 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,51 @@ +{ + "version": "2.0.0", + "tasks": [ + //Godot Editor Operations + { + "label": "godot-rust: Launch Debug Editor", + "detail": "Builds debug rust game library, then opens the project with Godot Editor", + "dependsOn": "godot-rust: Build Debug", + "type": "shell", + "options": { + "cwd": "${config:godot-rust.environment.godotProjectPath}" + }, + "command": "${config:godot-rust.environment.godotEditorPath} --editor", + "group": "build" + }, + { + "label": "godot-rust: Launch Release Editor", + "detail": "Builds release rust game library, then opens the project with Godot Editor", + "dependsOn": "godot-rust: Build Release", + "type": "shell", + "options": { + "cwd": "${config:godot-rust.environment.godotProjectPath}" + }, + "command": "${config:godot-rust.environment.godotEditorPath} --editor", + "group": "build" + }, + + //Build Operations + { + "label": "godot-rust: Build Debug", + "detail": "Builds debug rust game library", + "type": "shell", + "command": "cargo build --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin", + "group": "build" + }, + { + "label": "godot-rust: Build Release", + "detail": "Builds release rust game library", + "type": "shell", + "command": "cargo build --release --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin", + "group": "build" + }, + { + "label": "godot-rust: Clean", + "detail": "Removes all artifacts of rust game library and its dependencies", + "type": "shell", + "command": "cargo clean --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin", + "group": "build" + } + ] +} \ No newline at end of file diff --git a/addons/glecs/glecs.gdextension b/addons/glecs/glecs.gdextension index 051683e..f20d062 100644 --- a/addons/glecs/glecs.gdextension +++ b/addons/glecs/glecs.gdextension @@ -4,12 +4,14 @@ compatibility_minimum = 4.2 reloadable = true [libraries] -linux.debug.x86_64 = "./rust/glecs/target/debug/libglecs.so" - -linux.release.x86_64 = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.so" -windows.debug.x86_64 = "./rust/godot_entities_ecs/target/debug/super_ecgds.dll" -windows.release.x86_64 = "./rust/godot_entities_ecs/target/release/super_ecgds.dll" -macos.debug = "./rust/godot_entities_ecs/target/debug/libsuper_ecgds.dylib" -macos.release = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.dylib" -macos.debug.arm64 = "./rust/godot_entities_ecs/target/debug/libsuper_ecgds.dylib" -macos.release.arm64 = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.dylib" + +linux.release.x86_64 = "./bin/release/libglecs.so" +linux.debug.x86_64 = "./bin/debug/libglecs.so" + +windows.release.x86_64 = "./bin/release/libglecs.dll" +windows.debug.x86_64 = "./bin/debug/libglecs.dll" + +macos.release.x86_64 = "./bin/release/libglecs.dylib" +macos.debug.x86_64 = "./bin/debug/libglecs.dylib" +macos.release.arm64 = "./bin/release/libglecs.dylib" +macos.debug.arm64 = "./bin/debug/libglecs.dylib" \ No newline at end of file diff --git a/addons/glecs/glecs.gdextension.release b/addons/glecs/glecs.gdextension.release new file mode 100644 index 0000000..ecd5813 --- /dev/null +++ b/addons/glecs/glecs.gdextension.release @@ -0,0 +1,17 @@ +[configuration] +entry_symbol = "gdext_rust_init" +compatibility_minimum = 4.2 +reloadable = true + +[libraries] + +linux.release.x86_64 = "./bin/x86_64-unknown-linux-gnu/release/libglecs.so" +linux.debug.x86_64 = "./bin/x86_64-unknown-linux-gnu/debug/libglecs.so" + +windows.release.x86_64 = "./bin/x86_64-pc-windows-gnu/release/libglecs.dll" +windows.debug.x86_64 = "./bin/x86_64-pc-windows-gnu/debug/libglecs.dll" + +macos.release.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib" +macos.debug.x86_64 = "./bin/x86_64-apple-darwin/debug/libglecs.dylib" +macos.release.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib" +macos.debug.arm64 = "./bin/x86_64-apple-darwin/debug/libglecs.dylib" \ No newline at end of file diff --git a/addons/glecs/rust/flecs-rs b/addons/glecs/rust/flecs-rs index dc7f734..74e06d5 160000 --- a/addons/glecs/rust/flecs-rs +++ b/addons/glecs/rust/flecs-rs @@ -1 +1 @@ -Subproject commit dc7f734f9501e361483560a11eb952e83a63a1da +Subproject commit 74e06d5079c03df41ef19c70a975b41a62c8af9a