Skip to content

Commit

Permalink
check for bevy[-internal] in dev-dependencies only in test builds
Browse files Browse the repository at this point in the history
fixes issue where using `bevy` in `[dev-dependencies]` but not `[dependencies]` would cause macros to fail to compile in normal builds
  • Loading branch information
Waridley committed May 27, 2021
1 parent 0520947 commit a2ef41d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/bevy_macro_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit a2ef41d

Please sign in to comment.