diff --git a/godot/Rust.gdextension b/godot/Rust.gdextension index 599db9d..89ab2a2 100644 --- a/godot/Rust.gdextension +++ b/godot/Rust.gdextension @@ -1,14 +1,70 @@ [configuration] entry_symbol = "gdext_rust_init" -compatibility_minimum = 4.5 +compatibility_minimum = 4.1 reloadable = true [libraries] -linux.debug.x86_64 = "res://../rust/target/debug/libgodottest_rs.so" -linux.release.x86_64 = "res://../rust/target/release/libgodottest_rs.so" -windows.debug.x86_64 = "res://../rust/target/debug/godottest_rs.dll" -windows.release.x86_64 = "res://../rust/target/release/godottest_rs.dll" -macos.debug = "res://../rust/target/debug/libgodottest_rs.dylib" -macos.release = "res://../rust/target/release/libgodottest_rs.dylib" -macos.debug.arm64 = "res://../rust/target/debug/libgodottest_rs.dylib" -macos.release.arm64 = "res://../rust/target/release/libgodottest_rs.dylib" +"android.debug" = "res://../rust/target/debug/godottest_rs.so" +"android.release" = "res://../rust/target/release/godottest_rs.so" +"android.editor" = "res://../rust/target/debug/godottest_rs.so" +"android.debug.arm_32" = "res://../rust/target/armv7-linux-androideabi/debug/godottest_rs.so" +"android.release.arm_32" = "res://../rust/target/armv7-linux-androideabi/release/godottest_rs.so" +"android.editor.arm_32" = "res://../rust/target/armv7-linux-androideabi/debug/godottest_rs.so" +"android.debug.arm_64" = "res://../rust/target/aarch64-linux-android/debug/godottest_rs.so" +"android.release.arm_64" = "res://../rust/target/aarch64-linux-android/release/godottest_rs.so" +"android.editor.arm_64" = "res://../rust/target/aarch64-linux-android/debug/godottest_rs.so" +"android.debug.x86_32" = "res://../rust/target/i686-linux-android/debug/godottest_rs.so" +"android.release.x86_32" = "res://../rust/target/i686-linux-android/release/godottest_rs.so" +"android.editor.x86_32" = "res://../rust/target/i686-linux-android/debug/godottest_rs.so" +"android.debug.x86_64" = "res://../rust/target/x86_64-linux-android/debug/godottest_rs.so" +"android.release.x86_64" = "res://../rust/target/x86_64-linux-android/release/godottest_rs.so" +"android.editor.x86_64" = "res://../rust/target/x86_64-linux-android/debug/godottest_rs.so" +"ios.debug" = "res://../rust/target/debug/libgodottest_rs.ios.framework" +"ios.release" = "res://../rust/target/release/libgodottest_rs.ios.framework" +"ios.editor" = "res://../rust/target/debug/libgodottest_rs.ios.framework" +"ios.debug.arm_64" = "res://../rust/target/aarch64-apple-ios/debug/libgodottest_rs.ios.framework" +"ios.release.arm_64" = "res://../rust/target/aarch64-apple-ios/release/libgodottest_rs.ios.framework" +"ios.editor.arm_64" = "res://../rust/target/aarch64-apple-ios/debug/libgodottest_rs.ios.framework" +"linux.debug" = "res://../rust/target/debug/libgodottest_rs.so" +"linux.release" = "res://../rust/target/release/libgodottest_rs.so" +"linux.editor" = "res://../rust/target/debug/libgodottest_rs.so" +"linux.debug.arm_64" = "res://../rust/target/aarch64-unknown-linux-gnu/debug/libgodottest_rs.so" +"linux.release.arm_64" = "res://../rust/target/aarch64-unknown-linux-gnu/release/libgodottest_rs.so" +"linux.editor.arm_64" = "res://../rust/target/aarch64-unknown-linux-gnu/debug/libgodottest_rs.so" +"linux.debug.rv_64" = "res://../rust/target/riscv64gc-unknown-linux-gnu/debug/libgodottest_rs.so" +"linux.release.rv_64" = "res://../rust/target/riscv64gc-unknown-linux-gnu/release/libgodottest_rs.so" +"linux.editor.rv_64" = "res://../rust/target/riscv64gc-unknown-linux-gnu/debug/libgodottest_rs.so" +"linux.debug.x86_64" = "res://../rust/target/x86_64-unknown-linux-gnu/debug/libgodottest_rs.so" +"linux.release.x86_64" = "res://../rust/target/x86_64-unknown-linux-gnu/release/libgodottest_rs.so" +"linux.editor.x86_64" = "res://../rust/target/x86_64-unknown-linux-gnu/debug/libgodottest_rs.so" +"macos.debug" = "res://../rust/target/debug/libgodottest_rs.dylib" +"macos.release" = "res://../rust/target/release/libgodottest_rs.dylib" +"macos.editor" = "res://../rust/target/debug/libgodottest_rs.dylib" +"macos.debug.arm_64" = "res://../rust/target/aarch64-apple-darwin/debug/libgodottest_rs.dylib" +"macos.release.arm_64" = "res://../rust/target/aarch64-apple-darwin/release/libgodottest_rs.dylib" +"macos.editor.arm_64" = "res://../rust/target/aarch64-apple-darwin/debug/libgodottest_rs.dylib" +"macos.debug.x86_64" = "res://../rust/target/x86_64-apple-darwin/debug/libgodottest_rs.dylib" +"macos.release.x86_64" = "res://../rust/target/x86_64-apple-darwin/release/libgodottest_rs.dylib" +"macos.editor.x86_64" = "res://../rust/target/x86_64-apple-darwin/debug/libgodottest_rs.dylib" +"web.debug" = "res://../rust/target/debug/godottest_rs.wasm" +"web.release" = "res://../rust/target/release/godottest_rs.wasm" +"web.editor" = "res://../rust/target/debug/godottest_rs.wasm" +"web.debug.wasm32" = "res://../rust/target/wasm32-unknown-emscripten/debug/godottest_rs.wasm" +"web.release.wasm32" = "res://../rust/target/wasm32-unknown-emscripten/release/godottest_rs.wasm" +"web.editor.wasm32" = "res://../rust/target/wasm32-unknown-emscripten/debug/godottest_rs.wasm" +"windows.debug" = "res://../rust/target/debug/godottest_rs.dll" +"windows.release" = "res://../rust/target/release/godottest_rs.dll" +"windows.editor" = "res://../rust/target/debug/godottest_rs.dll" +"windows.debug.arm_64" = "res://../rust/target/aarch64-pc-windows-msvc/debug/godottest_rs.dll" +"windows.release.arm_64" = "res://../rust/target/aarch64-pc-windows-msvc/release/godottest_rs.dll" +"windows.editor.arm_64" = "res://../rust/target/aarch64-pc-windows-msvc/debug/godottest_rs.dll" +"windows.debug.x86_32" = "res://../rust/target/i686-pc-windows-msvc/debug/godottest_rs.dll" +"windows.release.x86_32" = "res://../rust/target/i686-pc-windows-msvc/release/godottest_rs.dll" +"windows.editor.x86_32" = "res://../rust/target/i686-pc-windows-msvc/debug/godottest_rs.dll" +"windows.debug.x86_64" = "res://../rust/target/x86_64-pc-windows-msvc/debug/godottest_rs.dll" +"windows.release.x86_64" = "res://../rust/target/x86_64-pc-windows-msvc/release/godottest_rs.dll" +"windows.editor.x86_64" = "res://../rust/target/x86_64-pc-windows-msvc/debug/godottest_rs.dll" + +[icons] +Player = "res://addons/rust/NodeRustFerris.svg" +AsyncRuntime = "res://addons/rust/NodeRustFerris.svg" diff --git a/godot/addons/rust/NodeRustFerris.svg b/godot/addons/rust/NodeRustFerris.svg new file mode 100644 index 0000000..101afce --- /dev/null +++ b/godot/addons/rust/NodeRustFerris.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/godot/addons/rust/NodeRustLarge.svg b/godot/addons/rust/NodeRustLarge.svg new file mode 100644 index 0000000..baa3918 --- /dev/null +++ b/godot/addons/rust/NodeRustLarge.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/godot/addons/rust/NodeRustSmall.svg b/godot/addons/rust/NodeRustSmall.svg new file mode 100644 index 0000000..4c4147c --- /dev/null +++ b/godot/addons/rust/NodeRustSmall.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 0668408..badee07 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -65,6 +65,25 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "gdext-gen" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972edc00a1f12e61a24244da606f77d4eadf8b8f4cfc93287ddef66c7979d71f" +dependencies = [ + "glob", + "regex", + "serde", + "toml", + "toml_edit", +] + [[package]] name = "gdextension-api" version = "0.3.0" @@ -83,6 +102,12 @@ version = "0.30.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12d847aeb25f41be4c0ec9587d624e9cd631bc007a8fd7ce3f5851e064c6460" +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + [[package]] name = "godot" version = "0.4.0" @@ -163,16 +188,33 @@ dependencies = [ name = "godottest_rs" version = "0.1.0" dependencies = [ + "gdext-gen", "godot", "tokio", ] +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "indexmap" +version = "2.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "io-uring" version = "0.7.10" @@ -347,6 +389,45 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "signal-hook-registry" version = "1.4.6" @@ -420,6 +501,48 @@ dependencies = [ "syn", ] +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "unicode-ident" version = "1.0.19" @@ -520,3 +643,12 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 1bfd9df..97e0523 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -9,3 +9,6 @@ crate-type = ["cdylib"] [dependencies] godot = { version = "0.4.0", features = ["api-4-5"] } tokio = { version = "1.47.1", features = ["full"] } + +[build-dependencies] +gdext-gen = { version = "0.1.1", features = ["dependencies", "find_icons"] } diff --git a/rust/build.rs b/rust/build.rs new file mode 100644 index 0000000..989b94d --- /dev/null +++ b/rust/build.rs @@ -0,0 +1,34 @@ +use gdext_gen::prelude::*; +use std::io::Result; + +fn main() -> Result<()> { + // All your variable initialization and setup goes here. + generate_gdextension_file( + BaseDirectory::ProjectFolder, + Some("../rust/target".into()), + Some("../godot/Rust.gdextension".into()), + true, + Some(Configuration::new( + EntrySymbol::GodotRustDefault, + Some((4, 1)), + None, + true, + false, + )), + Some(WindowsABI::MSVC), + Some(IconsConfig::new( + DefaultNodeIcon::NodeRust(NodeRust::Ferris, "rust".into()), + IconsCopyStrategy::new(true, true, "../godot/addons/rust".into(), false), + None, + IconsDirectories::new( + "addons".into(), + "editor".into(), + "rust".into(), + BaseDirectory::ProjectFolder.into(), + ), + )), + None, + )?; + + Ok(()) +}