50 lines
1.6 KiB
Makefile
50 lines
1.6 KiB
Makefile
PINNED_TOOLCHAIN := $(shell cat rust-toolchain)
|
|
|
|
prepare:
|
|
rustup target add wasm32-unknown-unknown
|
|
rustup component add clippy --toolchain ${PINNED_TOOLCHAIN}
|
|
rustup component add rustfmt --toolchain ${PINNED_TOOLCHAIN}
|
|
|
|
.PHONY: build-contract
|
|
build-contract:
|
|
cargo build --release --target wasm32-unknown-unknown -p validation-pool
|
|
cargo build --release --target wasm32-unknown-unknown -p availability
|
|
cargo build --release --target wasm32-unknown-unknown -p work-1
|
|
wasm-strip target/wasm32-unknown-unknown/release/validation_pool.wasm
|
|
wasm-strip target/wasm32-unknown-unknown/release/availability.wasm
|
|
wasm-strip target/wasm32-unknown-unknown/release/work_1.wasm
|
|
|
|
setup-test: build-contract
|
|
mkdir -p tests/wasm
|
|
cp ./target/wasm32-unknown-unknown/release/validation_pool.wasm tests/wasm
|
|
cp ./target/wasm32-unknown-unknown/release/availability.wasm tests/wasm
|
|
cp ./target/wasm32-unknown-unknown/release/work_1.wasm tests/wasm
|
|
|
|
test: setup-test
|
|
cd tests && cargo test
|
|
|
|
clippy:
|
|
cd validation-pool && cargo clippy --all-targets -- -D warnings
|
|
cd availability && cargo clippy --all-targets -- -D warnings
|
|
cd work-1 && cargo clippy --all-targets -- -D warnings
|
|
cd tests && cargo clippy --all-targets -- -D warnings
|
|
|
|
check-lint: clippy
|
|
cd validation_pool && cargo fmt -- --check
|
|
cd availability && cargo fmt -- --check
|
|
cd work-1 && cargo fmt -- --check
|
|
cd tests && cargo fmt -- --check
|
|
|
|
lint: clippy
|
|
cd validation-pool && cargo fmt
|
|
cd availability && cargo fmt
|
|
cd work-1 && cargo fmt
|
|
cd tests && cargo fmt
|
|
|
|
clean:
|
|
cd validation-pool && cargo clean
|
|
cd availability && cargo clean
|
|
cd work-1 && cargo clean
|
|
cd tests && cargo clean
|
|
rm -rf tests/wasm
|