#!/bin/bash # # Copyright (c) 2024 Mike Tsao for f in $(find . -name \*.rs -not -path "./target/*" -not -path "./vendor/*") do if ! grep -q -E '^\/\/ Copyright \(c\) 202[4-9] Mike Tsao$' "$f" then echo "$f missing header" head -n 1 "$f" exit 1 fi done # fix style cargo fmt --all # generate documentation similarly to how docs.rs does. We don't want this # version of the documentation, but it's good to catch errors that will happen # after a release to crates.io. cargo doc --no-default-features --all-features --no-deps # generate documentation cargo doc \ --no-deps --workspace --document-private-items \ --examples --features="std hound" # build examples. `cargo test` should do this, but it will fail cargo build --example minidaw --features="std egui egui_extras ensnare-services/audio ensnare-services/midi" || exit cargo build --example hello-world --features="std hound egui_extras" || exit cargo build --example widget-explorer --features="std hound egui_extras" || exit for e in pocket-calculator entity-gui-explorer render subtractive-patch-converter; do cargo build --example $e || exit done # build and test cargo test --workspace cargo test --examples # cargo build --no-default-features && \ # this is disabled - see https://github.com/ensnare-org/ensnare/issues/1