diff --git a/AGENTS.md b/AGENTS.md index 2fca58d..1c82cba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,6 +6,11 @@ - It has been moved here to become a refined, standalone developer tool - Existing code may not adhere to the requirements defined herein, however, new code and refactors should +## Building + +- `cargo run` builds and runs the app against the pinned, published LiveKit crates +- To build against a local `rust-sdks` checkout, comment out the published `livekit`/`livekit-api` lines in _Cargo.toml_ and uncomment the `path` lines below them (see "Building against a local rust-sdks" in _README.md_) + ## UI best practices - This application uses [egui](https://docs.rs/egui/latest/egui/) diff --git a/Cargo.toml b/Cargo.toml index f92a17e..117bc0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,11 @@ winit = { version = "0.30.13", features = [ "android-native-activity" ] } livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } -# For local development, use a path override to the rust-sdks repo: -# livekit = { path = "../rust-sdks", features = ["rustls-tls-native-roots"] } +# For local SDK development, comment out the two lines above and uncomment these +# (clone https://github.com/livekit/rust-sdks to ../rust-sdks first; see +# "Building against a local rust-sdks" in README.md): +# livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } +# livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } [package.metadata.bundle] name = "LiveKit Client" diff --git a/README.md b/README.md index 4d6858b..e6da3c6 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,32 @@ An example of building a cross-platform, GUI application using the [LiveKit Rust - [x] Simulate fault scenarios (e.g., reconnect, migration, etc.) - [x] Send/receive remote procedure calls (RPC) - [x] Send/receive data streams + +## Building + +The app builds and runs against the pinned, published LiveKit crates by default: + +```sh +cargo run # debug +cargo run --release # optimized +``` + +The Rust toolchain is pinned in `rust-toolchain.toml` and selected automatically. The first build downloads a prebuilt `libwebrtc`, so it needs network access. + +### Building against a local rust-sdks + +To build against a local checkout of the [LiveKit Rust SDK](https://github.com/livekit/rust-sdks) instead of the published crates: + +1. Clone the SDK next to this repository: + ```sh + git clone https://github.com/livekit/rust-sdks ../rust-sdks + ``` +2. In `Cargo.toml`, comment out the two published `livekit` / `livekit-api` lines and uncomment the `path` lines below them (edit the paths if your checkout lives elsewhere): + ```toml + livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } + livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } + ``` + These are plain `path` dependencies, so cargo re-resolves automatically — no `cargo update` needed. +3. `cargo run` — and rust-analyzer — now build against the local sources. + +To return to the published crates, reverse step 2: uncomment the two version lines and comment the `path` lines back out. diff --git a/cspell.yml b/cspell.yml index dc39d36..8839cf4 100644 --- a/cspell.yml +++ b/cspell.yml @@ -20,6 +20,7 @@ words: - fira - firacode - idents + - libwebrtc - livekit - msvc - noninteractive