mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 02:01:35 +00:00
Put secio behind a feature flag in the facade (#219)
* Put secio behind a feature flag in the facade * Define the features required by examples * Test both with and without Cargo features
This commit is contained in:
@ -32,8 +32,11 @@ jobs:
|
||||
name: Prepare docker container for building
|
||||
command: docker build --pull --no-cache -t rust-libp2p -f .circleci/images/rust-libp2p/Dockerfile .
|
||||
- run:
|
||||
name: Run tests, inside a docker image
|
||||
command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test
|
||||
name: Run tests, inside a docker image, with no feature
|
||||
command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test --no-default-features
|
||||
- run:
|
||||
name: Run tests, inside a docker image, with all features
|
||||
command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test --all-features
|
||||
- save_cache:
|
||||
key: test-cache
|
||||
paths:
|
||||
|
@ -3,6 +3,9 @@ name = "libp2p"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[features]
|
||||
default = ["libp2p-secio"]
|
||||
|
||||
[dependencies]
|
||||
bytes = "0.4"
|
||||
futures = "0.1"
|
||||
@ -21,7 +24,7 @@ tokio-io = "0.1"
|
||||
|
||||
[target.'cfg(not(target_os = "emscripten"))'.dependencies]
|
||||
libp2p-dns = { path = "../dns" }
|
||||
libp2p-secio = { path = "../secio" }
|
||||
libp2p-secio = { path = "../secio", optional = true }
|
||||
libp2p-tcp-transport = { path = "../tcp-transport" }
|
||||
tokio-core = "0.1"
|
||||
|
||||
@ -36,3 +39,29 @@ structopt = "0.2"
|
||||
tokio-core = "0.1"
|
||||
tokio-io = "0.1"
|
||||
tokio-stdin = "0.1"
|
||||
|
||||
[[example]]
|
||||
name = "echo-dialer"
|
||||
required-features = ["libp2p-secio"]
|
||||
|
||||
[[example]]
|
||||
name = "echo-server"
|
||||
required-features = ["libp2p-secio"]
|
||||
|
||||
[[example]]
|
||||
name = "floodsub"
|
||||
required-features = ["libp2p-secio"]
|
||||
|
||||
[[example]]
|
||||
name = "kademlia"
|
||||
required-features = ["libp2p-secio"]
|
||||
|
||||
[[example]]
|
||||
name = "ping-client"
|
||||
required-features = ["libp2p-secio"]
|
||||
|
||||
[[example]]
|
||||
name = "random_peerid"
|
||||
|
||||
[[example]]
|
||||
name = "relay"
|
||||
|
@ -36,7 +36,7 @@ pub extern crate libp2p_peerstore as peerstore;
|
||||
pub extern crate libp2p_ping as ping;
|
||||
pub extern crate libp2p_ratelimit as ratelimit;
|
||||
pub extern crate libp2p_relay as relay;
|
||||
#[cfg(not(target_os = "emscripten"))]
|
||||
#[cfg(all(not(target_os = "emscripten"), feature = "libp2p-secio"))]
|
||||
pub extern crate libp2p_secio as secio;
|
||||
#[cfg(not(target_os = "emscripten"))]
|
||||
pub extern crate libp2p_tcp_transport as tcp;
|
||||
|
Reference in New Issue
Block a user