From a2ef41d69d33491d082bd62aff37ba347fbbb709 Mon Sep 17 00:00:00 2001 From: Waridley Date: Thu, 27 May 2021 13:33:33 -0500 Subject: [PATCH] check for `bevy[-internal]` in dev-dependencies only in test builds fixes issue where using `bevy` in `[dev-dependencies]` but not `[dependencies]` would cause macros to fail to compile in normal builds --- crates/bevy_macro_utils/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/bevy_macro_utils/src/lib.rs b/crates/bevy_macro_utils/src/lib.rs index 2933d9d8000d9c..ed4abc59d271e6 100644 --- a/crates/bevy_macro_utils/src/lib.rs +++ b/crates/bevy_macro_utils/src/lib.rs @@ -44,11 +44,12 @@ impl BevyManifest { }; let deps = self.manifest.dependencies.as_ref(); - let deps_dev = self.manifest.dev_dependencies.as_ref(); - deps.and_then(find_in_deps) - .or_else(|| deps_dev.and_then(find_in_deps)) - .unwrap_or_else(|| get_path(name)) + let path = deps.and_then(find_in_deps); + #[cfg(test)] + let path = path.or_else(|| self.manifest.dev_dependencies.as_ref().and_then(find_in_deps)); + + path.unwrap_or_else(|| get_path(name)) } }