Skip to content

Commit

Permalink
*: Import libp2p with default-features = false (#2574)
Browse files Browse the repository at this point in the history
* *: 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
  • Loading branch information
mxinden authored Mar 22, 2022
1 parent 3abef2e commit 6cc3b4e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion misc/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion protocols/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/mdns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion protocols/relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/rendezvous/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ] }

Expand Down
2 changes: 1 addition & 1 deletion swarm-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 6cc3b4e

Please sign in to comment.