move the client example to its own crate

We're likely to add more examples with more dependencies (e.g. ffmpeg,
gstreamer, webrtc). Nice to not have their deps in the main crate's
dev-dependencies, and likewise to have each example show its true
dependencies.

As mentioned here:
https://github.com/scottlamb/retina/issues/19#issuecomment-902302720
This commit is contained in:
Scott Lamb 2022-07-13 10:51:03 -07:00
parent 33bd057ade
commit d75d5585f5
8 changed files with 47 additions and 14 deletions

View File

@ -35,22 +35,24 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
- name: Build
run: cargo build --all-features --all-targets --workspace
- name: Test
run: cargo test --all-features --all-targets
run: cargo test --all-features --all-targets --workspace
- name: Check fuzz tests
run: cd fuzz && cargo check
run: cd fuzz && cargo check --workspace
- name: Check main crate formatting
if: matrix.rust == 'stable'
run: cargo fmt -- --check
- name: Check fuzz crate formatting
if: matrix.rust == 'stable'
run: cd fuzz && cargo fmt -- --check
run: cd fuzz && cargo fmt -- --check --all
- name: Clippy on main crate
if: matrix.rust == 'stable'
run: cargo clippy -- -D warnings
run: cargo clippy --workspace -- -D warnings
- name: Clippy on fuzz crate
if: matrix.rust == 'stable'
run: cd fuzz && cargo clippy -- -D warnings
run: cd fuzz && cargo clippy --workspace -- -D warnings
license:
name: Check copyright/license headers
@ -58,4 +60,4 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py

20
Cargo.lock generated
View File

@ -137,6 +137,22 @@ dependencies = [
"vec_map",
]
[[package]]
name = "client"
version = "0.0.0"
dependencies = [
"anyhow",
"bytes",
"futures",
"itertools",
"log",
"mylog",
"retina",
"structopt",
"tokio",
"url",
]
[[package]]
name = "cookie-factory"
version = "0.3.2"
@ -900,7 +916,6 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
name = "retina"
version = "0.4.0"
dependencies = [
"anyhow",
"base64",
"bitreader",
"bytes",
@ -909,7 +924,6 @@ dependencies = [
"h264-reader",
"hex",
"http-auth",
"itertools",
"log",
"mylog",
"once_cell",
@ -919,7 +933,6 @@ dependencies = [
"rtsp-types",
"sdp-types",
"smallvec",
"structopt",
"thiserror",
"time",
"tokio",
@ -1194,7 +1207,6 @@ dependencies = [
"mio",
"num_cpus",
"once_cell",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",

View File

@ -1,3 +1,7 @@
[workspace]
members = [".", "examples/client"]
default-members = ["."]
[package]
name = "retina"
version = "0.4.0"
@ -34,12 +38,9 @@ tokio-util = { version = "0.7.3", features = ["codec"] }
url = "2.2.1"
[dev-dependencies]
anyhow = "1.0.41"
criterion = { version = "0.3.4", features = ["async_tokio"] }
itertools = "0.10.1"
mylog = { git = "https://github.com/scottlamb/mylog" }
structopt = "0.3.21"
tokio = { version = "1.5.0", features = ["fs", "io-util", "macros", "parking_lot", "rt-multi-thread", "signal", "test-util"] }
tokio = { version = "1.5.0", features = ["io-util", "macros", "rt-multi-thread", "test-util"] }
[profile.bench]
debug = true

View File

@ -0,0 +1,18 @@
[package]
name = "client"
version = "0.0.0"
publish = false
edition = "2021"
rust-version = "1.59"
[dependencies]
bytes = "1.0.1"
futures = "0.3.14"
log = "0.4.8"
retina = { path = "../../" }
tokio = { version = "1.5.0", features = ["fs", "io-util", "macros", "rt-multi-thread", "signal"] }
url = "2.2.1"
anyhow = "1.0.41"
itertools = "0.10.1"
mylog = { git = "https://github.com/scottlamb/mylog" }
structopt = "0.3.21"