Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
Switch to single bevy dep with no default features (#33)
Browse files Browse the repository at this point in the history
Impossible to use a patched bevy 0.5 version alongside a dep that
depends on bevy sub crates (bevy_ecs, bevy_app, etc).

Doing so gives: error[E0277]: the trait bound `NetworkingPlugin: bevy::prelude::Plugin` is not satisfied

See: https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#bevy-features

Guidelines from bevy now to use `bevy` without default features in this
case.

Discord link to start of conversation:
https://discord.com/channels/691052431525675048/691052431974465548/860423772979593246
  • Loading branch information
RJ authored Jul 2, 2021
1 parent ab2fcfc commit bb9977d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ use-webrtc = [
]

[dependencies]
bevy_app = "0.5"
bevy_core = "0.5"
bevy_ecs = "0.5"
bevy_tasks = "0.5"
bevy = {version = "0.5", default-features = false}
turbulence = "0.3"
naia-client-socket = { version = "0.6", features = ["multithread"] }
bytes = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/channels.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unused)]

use bevy_tasks::{Task, TaskPool};
use bevy::tasks::{Task, TaskPool};
use futures::{stream, Stream};
use futures_timer::Delay;
use std::{
Expand Down
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use bevy_app::{AppBuilder, Events, Plugin, CoreStage};
use bevy_ecs::prelude::*;
use bevy_tasks::{IoTaskPool, TaskPool};
use bevy_core::{FixedTimestep};
use bevy::{
app::{AppBuilder, Events, Plugin, CoreStage},
ecs::prelude::*,
tasks::{IoTaskPool, TaskPool, Task},
core::FixedTimestep,
};

#[cfg(not(target_arch = "wasm32"))]
use crossbeam_channel::{unbounded, Receiver, Sender, SendError as CrossbeamSendError};
Expand Down Expand Up @@ -120,7 +122,7 @@ pub struct NetworkResource {
#[cfg(not(target_arch = "wasm32"))]
#[allow(dead_code)] // FIXME: remove this struct?
struct ServerListener {
receiver_task: bevy_tasks::Task<()>,
receiver_task: Task<()>,
// needed to keep receiver_task alive
sender: ServerSender,
socket_address: SocketAddr,
Expand Down
4 changes: 2 additions & 2 deletions src/transport.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(not(target_arch = "wasm32"))]
use bevy_tasks::Task;
use bevy_tasks::TaskPool;
use bevy::tasks::Task;
use bevy::tasks::TaskPool;
use bytes::Bytes;
use std::{error::Error, net::SocketAddr, sync::{Arc, RwLock}};
use instant::{Instant, Duration};
Expand Down

0 comments on commit bb9977d

Please sign in to comment.