Skip to content

Commit

Permalink
refactor: move examples to common location
Browse files Browse the repository at this point in the history
Refactor examples into separate binary crates.

Fixes #3111.

Pull-Request: #3509.
  • Loading branch information
yellowred authored Mar 8, 2023
1 parent 2c10cd8 commit b63e05d
Show file tree
Hide file tree
Showing 30 changed files with 1,166 additions and 1,492 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/master' }}

- name: Run ipfs-kad example
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad --features full
run: cd ./examples/ipfs-kad/ && RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run

rustfmt:
runs-on: ubuntu-latest
Expand Down
155 changes: 143 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 9 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ libp2p-tcp = { path = "transports/tcp", features = ["tokio"] }
[workspace]
members = [
"core",
"examples/chat-example",
"examples/dcutr",
"examples/distributed-key-value-store",
"examples/file-sharing",
"examples/identify",
"examples/ipfs-kad",
"examples/ipfs-private",
"examples/ping-example",
"examples/rendezvous",
"misc/metrics",
"misc/multistream-select",
"misc/rw-stream-sink",
Expand Down Expand Up @@ -180,42 +189,6 @@ members = [
"interop-tests"
]

[[example]]
name = "chat"
required-features = ["full"]

[[example]]
name = "chat-tokio"
required-features = ["full"]

[[example]]
name = "file-sharing"
required-features = ["full"]

[[example]]
name = "gossipsub-chat"
required-features = ["full"]

[[example]]
name = "ipfs-private"
required-features = ["full"]

[[example]]
name = "ipfs-kad"
required-features = ["full"]

[[example]]
name = "ping"
required-features = ["full"]

[[example]]
name = "mdns-passive-discovery"
required-features = ["full"]

[[example]]
name = "distributed-key-value-store"
required-features = ["full"]

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
[package.metadata.docs.rs]
Expand Down
Loading

0 comments on commit b63e05d

Please sign in to comment.