Skip to content

Commit

Permalink
can depend on subcrates
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Apr 26, 2024
1 parent add7b04 commit f85b084
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
categories = ["game-development"]

[features]
default = ["bevy"]
subcrates = ["bevy_app", "bevy_log", "bevy_utils"]

[dependencies]
sentry = "0.32.3"
sentry-tracing = "0.32.3"
bevy = { version = "0.14.0-dev", git = "https://github.com/bevyengine/bevy", default-features = false }
bevy = { version = "0.14.0-dev", git = "https://github.com/bevyengine/bevy", default-features = false, optional = true }
bevy_app = { version = "0.14.0-dev", git = "https://github.com/bevyengine/bevy", default-features = false, optional = true }
bevy_log = { version = "0.14.0-dev", git = "https://github.com/bevyengine/bevy", default-features = false, optional = true }
bevy_utils = { version = "0.14.0-dev", git = "https://github.com/bevyengine/bevy", default-features = false, optional = true }
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use std::env;

#[cfg(all(feature = "bevy", not(feature = "subcrates")))]
use bevy::{
app::App,
log::{
Expand All @@ -24,6 +25,19 @@ use bevy::{
utils::tracing::{Event, Level, Subscriber},
};

#[cfg(feature = "subcrates")]
use bevy_app::App;
#[cfg(feature = "subcrates")]
use bevy_log::{
tracing_subscriber::{
layer::{self, SubscriberExt},
Layer,
},
BoxedSubscriber, Level,
};
#[cfg(feature = "subcrates")]
use bevy_utils::tracing::{Event, Subscriber};

use sentry::ClientInitGuard;

struct SentryLayer {
Expand Down

0 comments on commit f85b084

Please sign in to comment.