Makefile (1548B)
1 # Makefile to aid with local development and testing 2 # This is not required for automated builds 3 4 ifeq ($(OS),Windows_NT) 5 PLATFORM := win 6 else 7 UNAME := $(shell uname) 8 ifeq ($(UNAME),Linux) 9 PLATFORM := linux 10 endif 11 ifeq ($(UNAME),Darwin) 12 PLATFORM := mac 13 endif 14 endif 15 16 check-format: 17 cargo +nightly fmt -- --check 18 19 check-docs: 20 cargo doc --no-deps --workspace --all-features 21 22 clippy: 23 cargo +nightly clippy --all-features --all-targets -- -D warnings 24 25 test-local: 26 cargo test --all-features 27 28 test-wasm: 29 cd sdk && wasm-pack test --node 30 31 test-wasm-web: 32 cd sdk && wasm-pack test --chrome --headless -- --features="serialize_thumbnails" 33 34 # Full local validation, build and test all features including wasm 35 # Run this before pushing a PR to pre-validate 36 test: check-format check-docs clippy test-local test-wasm-web 37 38 # Auto format code according to standards 39 fmt: 40 cargo +nightly fmt 41 42 # Builds and views documentation 43 doc: 44 cargo doc --no-deps --open 45 46 # Builds a set of test images using the make_test_images example 47 # Outputs to release/test-images 48 images: 49 cargo run --release --bin make_test_images 50 51 # Exports JSON schema files so that types can easily be exported to other languages 52 # Outputs to release/json-schema 53 schema: 54 cargo run --release --bin export_schema 55 56 # Runs the client example using test image and output to target/tmp/client.jpg 57 client: 58 cargo run --example client sdk/tests/fixtures/ca.jpg target/tmp/client.jpg 59 60 # Runs the show example 61 show: 62 cargo run --example show -- sdk/tests/fixtures/ca.jpg