*: Import libp2p with default-features = false (#2574)

* *: Import `libp2p` with `default-features = false`

While not a win in most cases, it reduces compile time for tests of
individual crates.

* Cargo.toml: Set features for examples
This commit is contained in:
Max Inden
2022-03-22 11:22:17 +01:00
committed by GitHub
parent 3abef2e70c
commit 6cc3b4ec52
7 changed files with 22 additions and 6 deletions

View File

@@ -152,6 +152,22 @@ members = [
"transports/wasm-ext"
]
[[example]]
name = "chat"
required-features = ["floodsub"]
[[example]]
name = "chat-tokio"
required-features = ["tcp-tokio", "mdns"]
[[example]]
name = "file-sharing"
required-features = ["request-response"]
[[example]]
name = "gossipsub-chat"
required-features = ["gossipsub"]
[[example]]
name = "ipfs-private"
required-features = ["gossipsub"]

View File

@@ -35,6 +35,6 @@ libp2p-gossipsub = { version = "0.37.0", path = "../../protocols/gossipsub", op
log = "0.4.0"
env_logger = "0.8.1"
futures = "0.3.1"
libp2p = { path = "../../", features = ["metrics"] }
libp2p = { path = "../../", default-features = false, features = ["metrics", "ping", "tcp-async-io", "dns-async-std", "websocket", "noise", "mplex", "yamux"] }
hyper = { version="0.14", features = ["server", "tcp", "http1"] }
tokio = { version = "1", features = ["rt-multi-thread"] }

View File

@@ -30,7 +30,7 @@ prost-build = "0.9"
[dev-dependencies]
env_logger = "0.8.3"
libp2p = { path = "../..", features = ["dcutr"] }
libp2p = { path = "../..", default-features = false, features = ["dcutr", "relay", "plaintext", "identify", "tcp-async-io", "ping", "noise", "dns-async-std"] }
libp2p-identify = { path = "../identify" }
libp2p-plaintext = { path = "../../transports/plaintext" }
libp2p-relay = { path = "../relay" }

View File

@@ -28,5 +28,5 @@ void = "1.0.2"
[dev-dependencies]
async-std = { version = "1.9.0", features = ["attributes"] }
env_logger = "0.9.0"
libp2p = { path = "../.." }
libp2p = { path = "../..", default-features = false, features = ["mdns", "tcp-async-io", "dns-async-std", "websocket", "noise", "mplex", "yamux"] }
tokio = { version = "1.15", default-features = false, features = ["macros", "rt", "rt-multi-thread", "time"] }

View File

@@ -34,7 +34,7 @@ prost-build = "0.9"
[dev-dependencies]
env_logger = "0.9.0"
libp2p = { path = "../.." }
libp2p = { path = "../..", default-features = false, features = ["identify", "relay", "ping", "noise", "plaintext", "tcp-async-io"] }
libp2p-identify = { path = "../identify" }
libp2p-kad = { path = "../kad" }
libp2p-ping = { path = "../ping" }

View File

@@ -29,7 +29,7 @@ instant = "0.1.11"
[dev-dependencies]
async-trait = "0.1"
env_logger = "0.8"
libp2p = { path = "../.." }
libp2p = { path = "../..", default-features = false, features = ["ping", "identify", "tcp-async-io", "dns-async-std", "websocket", "noise", "mplex", "yamux", "rendezvous"] }
rand = "0.8"
tokio = { version = "1.15", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }

View File

@@ -18,6 +18,6 @@ syn = { version = "1.0.8", default-features = false, features = ["clone-impls",
quote = "1.0"
[dev-dependencies]
libp2p = { path = "../" }
libp2p = { path = "../", default-features = false, features = ["ping", "identify", "kad"] }
either = "1.6.0"
futures = "0.3.1"