From ee95440d0466bbb267c13412296734e81d5c6e8d Mon Sep 17 00:00:00 2001 From: Joey Pollack Date: Wed, 15 May 2024 20:00:46 -0400 Subject: [PATCH] Moves the hello plugin out to it's own crate --- Cargo.lock | 18 ++++++++---------- Cargo.toml | 17 ++++++++++++----- crates/hello/Cargo.toml | 11 +++++++++++ .../mod.rs => crates/hello/src/hello.rs | 0 crates/hello/src/lib.rs | 3 +++ src/main.rs | 4 ++-- 6 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 crates/hello/Cargo.toml rename src/hello_plugin/mod.rs => crates/hello/src/hello.rs (100%) create mode 100644 crates/hello/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index f7a62a3..10390c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,7 +293,6 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b9eadaacf8fe971331bc3f250f35c18bc9dace3f96b483062f38ac07e3a1b4" dependencies = [ - "bevy_dylib", "bevy_internal", ] @@ -470,15 +469,6 @@ dependencies = [ "sysinfo", ] -[[package]] -name = "bevy_dylib" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922826e3b8f37c19836b49e18ceca662260cce87ab8faa4db6df8433903660cc" -dependencies = [ - "bevy_internal", -] - [[package]] name = "bevy_ecs" version = "0.13.2" @@ -1172,6 +1162,7 @@ name = "bricks" version = "0.1.0" dependencies = [ "bevy", + "hello", ] [[package]] @@ -2008,6 +1999,13 @@ dependencies = [ "winapi", ] +[[package]] +name = "hello" +version = "0.1.0" +dependencies = [ + "bevy", +] + [[package]] name = "hermit-abi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 0c8a7b0..6b684f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,11 +3,9 @@ name = "bricks" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -bevy = { version = "0.13.0", features = ["dynamic_linking"] } - +[workspace] +resolver = "2" # Important! wgpu/Bevy needs this! +members = ["crates/hello"] # Enable a small amount of optimization in debug mode [profile.dev] @@ -25,3 +23,12 @@ rustflags = ["-C", "link-arg=-fuse-ld=lld"] # for Windows [target.x86_64-pc-windows-msvc] linker = "rust-lld.exe" + +[dependencies] +hello = { workspace = true } +bevy = { workspace = true } +# bevy = { version = "0.13.0", features = ["dynamic_linking"] } + +[workspace.dependencies] +hello = { path = "crates/hello" } +bevy = { version = "0.13.0" } \ No newline at end of file diff --git a/crates/hello/Cargo.toml b/crates/hello/Cargo.toml new file mode 100644 index 0000000..62570db --- /dev/null +++ b/crates/hello/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "hello" +description = "A Test Module For the Bevy App" +version = "0.1.0" +edition = "2021" + +[dependencies] +bevy = { workspace = true } + + + diff --git a/src/hello_plugin/mod.rs b/crates/hello/src/hello.rs similarity index 100% rename from src/hello_plugin/mod.rs rename to crates/hello/src/hello.rs diff --git a/crates/hello/src/lib.rs b/crates/hello/src/lib.rs new file mode 100644 index 0000000..9f79a81 --- /dev/null +++ b/crates/hello/src/lib.rs @@ -0,0 +1,3 @@ + + +pub mod hello; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 4811c80..5345a43 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,8 @@ use bevy::prelude::*; -mod hello_plugin; -use hello_plugin::HelloPlugin; +// extern crate hello; +use hello::hello::HelloPlugin; fn main() {