diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 19bc2ee1..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,5 +0,0 @@ -[alias] -run-wasm = ["run", "--release", "--package", "run-wasm", "--"] - -[target.wasm32-unknown-unknown] -runner = "wasm-bindgen-test-runner" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fabd911d..d467c540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,8 @@ jobs: FEATURES: ${{ format(',{0}', matrix.platform.features ) }} CMD: ${{ matrix.platform.cmd }} RUSTDOCFLAGS: -Dwarnings + # Use `wasm-bindgen-cli` tooling when running wasm-bindgen tests. + CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner runs-on: ${{ matrix.platform.os }} steps: diff --git a/.gitignore b/.gitignore index 2f455754..dc931d9c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ Cargo.lock /.idea /.vscode + +# Allow people to customize this for their own checkouts. +.cargo/config.toml diff --git a/Cargo.toml b/Cargo.toml index 985a5494..20a2eebb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,3 @@ -[workspace] -members = ["run-wasm"] - [package] name = "softbuffer" version = "0.4.8" diff --git a/README.md b/README.md index f5cc4096..54921377 100644 --- a/README.md +++ b/README.md @@ -64,14 +64,6 @@ Beware that big endian targets are much less tested, and may behave incorrectly. Pull requests to add support for new platforms are welcome! -## WebAssembly - -To run an example with the web backend: `cargo run-wasm --example winit` - -## Android - -To run the Android-specific example on an Android phone: `cargo apk r --example winit_android` or `cargo apk r --example winit_multithread_android`. - ## Example ```rust,no_run @@ -202,6 +194,32 @@ impl ApplicationHandler for App { } ``` +## Test on WebAssembly + +To run an example with the web backend, add the following to `.cargo/config.toml`: +```toml +[target.'cfg(target_family = "wasm")'] +runner = "wasm-server-runner" +``` + +And then run: + +```sh +cargo install wasm-server-runner +cargo run --target wasm32-unknown-unknown --example winit +``` + +And open the link to view the result in the browser. + +## Test on Android + +To run the Android-specific example on an Android phone: +```sh +cargo apk r --example winit_android +# or +cargo apk r --example winit_multithread_android +``` + ## MSRV Policy This crate's Minimum Supported Rust Version (MSRV) is **1.71**. Changes to diff --git a/run-wasm/Cargo.toml b/run-wasm/Cargo.toml deleted file mode 100644 index 35dcf31d..00000000 --- a/run-wasm/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "run-wasm" -version = "0.1.0" -edition = "2021" - -[dependencies] -cargo-run-wasm = "0.4.0" diff --git a/run-wasm/src/main.rs b/run-wasm/src/main.rs deleted file mode 100644 index c57ab2c8..00000000 --- a/run-wasm/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - cargo_run_wasm::run_wasm_cli_with_css("body { margin: 0px; }"); -}