forked from casper-ecosystem/cep-78-enhanced-nft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (43 loc) · 2.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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}
build-contract:
cd contract && cargo build --release --target wasm32-unknown-unknown
cd client/mint_session && cargo build --release --target wasm32-unknown-unknown
cd client/balance_of_session && cargo build --release --target wasm32-unknown-unknown
cd client/owner_of_session && cargo build --release --target wasm32-unknown-unknown
cd client/get_approved_session && cargo build --release --target wasm32-unknown-unknown
cd client/transfer_session && cargo build --release --target wasm32-unknown-unknown
cd test-contracts/minting_contract && cargo build --release --target wasm32-unknown-unknown
wasm-strip contract/target/wasm32-unknown-unknown/release/contract.wasm
wasm-strip client/mint_session/target/wasm32-unknown-unknown/release/mint_call.wasm
wasm-strip client/balance_of_session/target/wasm32-unknown-unknown/release/balance_of_call.wasm
wasm-strip client/owner_of_session/target/wasm32-unknown-unknown/release/owner_of_call.wasm
wasm-strip client/get_approved_session/target/wasm32-unknown-unknown/release/get_approved_call.wasm
wasm-strip client/transfer_session/target/wasm32-unknown-unknown/release/transfer_call.wasm
wasm-strip test-contracts/minting_contract/target/wasm32-unknown-unknown/release/minting_contract.wasm
test: build-contract
mkdir -p tests/wasm
cp contract/target/wasm32-unknown-unknown/release/contract.wasm tests/wasm
cp client/mint_session/target/wasm32-unknown-unknown/release/mint_call.wasm tests/wasm
cp client/balance_of_session/target/wasm32-unknown-unknown/release/balance_of_call.wasm tests/wasm
cp client/owner_of_session/target/wasm32-unknown-unknown/release/owner_of_call.wasm tests/wasm
cp client/get_approved_session/target/wasm32-unknown-unknown/release/get_approved_call.wasm tests/wasm
cp client/transfer_session/target/wasm32-unknown-unknown/release/transfer_call.wasm tests/wasm
cp test-contracts/minting_contract/target/wasm32-unknown-unknown/release/minting_contract.wasm tests/wasm
cd tests && cargo test
clippy:
cd contract && cargo clippy --all-targets -- -D warnings
cd tests && cargo clippy --all-targets -- -D warnings
check-lint: clippy
cd contract && cargo fmt -- --check
cd tests && cargo fmt -- --check
lint: clippy
cd contract && cargo fmt
cd tests && cargo fmt
clean:
cd contract && cargo clean
cd tests && cargo clean
rm -rf tests/wasm