.PHONY: setup clean fmt-check fmt clippy clippy-release check check-release check-wasm build build-release test test-release integration harness harness-down docker-rustsdk-build docker-rustsdk-run docker-test ci doc help
setup:
rustup component add rustfmt clippy
rustup target install wasm32-unknown-unknown
cargo fetch
lefthook install
clean:
cargo clean
fmt-check:
cargo fmt --all -- --check
fmt:
cargo fmt --all
clippy:
cargo clippy --workspace --all-targets -- -D warnings
clippy-release:
cargo clippy --release --workspace --all-targets -- -D warnings
check:
cargo check --workspace
check-release:
cargo check --release --workspace
check-wasm:
cargo check --target wasm32-unknown-unknown
build:
cargo build --workspace
build-release:
cargo build --release --workspace
test:
cargo test --workspace --lib --examples --tests
test-release:
cargo test --release --workspace --lib --examples --tests
integration:
cargo test --test features_runner --
harness:
./test-harness.sh up
harness-down:
./test-harness.sh down
docker-rustsdk-build:
docker build -t rust-sdk-testing .
docker-rustsdk-run:
docker ps -a
docker run -it --network host rust-sdk-testing:latest
docker-test: harness docker-rustsdk-build docker-rustsdk-run
ci: fmt-check clippy test build
doc:
cargo doc --no-deps --open
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-30s\033[0m %s\n", helpCommand,helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help