-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.24 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
51
52
53
54
55
56
#!/usr/bin/make -f
CONTAINER_RUNTIME := $(shell which docker 2>/dev/null || which podman 2>/dev/null)
CONTRACT_NAME := ats_smart_contract
.PHONY: all
all: clean fmt lint test schema optimize
.PHONY: all-arm
all-arm: clean fmt lint test schema optimize-arm
.PHONY: clean
clean:
@cargo clean
@rm -Rf artifacts/*
.PHONY: fmt
fmt:
@cargo fmt --all -- --check
.PHONY: lint
lint:
@cargo clippy
.PHONY: build
build:
@cargo build
.PHONY: test
test:
@cargo test --verbose
.PHONY: schema
schema:
@cargo run --example schema
.PHONY: coverage
coverage:
@cargo tarpaulin --ignore-tests --out Html
.PHONY: optimize
optimize:
$(CONTAINER_RUNTIME) run --rm -v $(CURDIR):/code:Z \
--mount type=volume,source=ats-smart-contract_cache,target=/code/target \
--mount type=volume,source=ats-smart-contract_registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.16.0
#
.PHONY: optimize-arm
optimize-arm:
$(CONTAINER_RUNTIME) run --rm -v $(CURDIR):/code:Z \
--mount type=volume,source=ats-smart-contract_cache,target=/code/target \
--mount type=volume,source=ats-smart-contract_registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer-arm64:0.16.0
.PHONY: install
install: optimize
@cp artifacts/$(CONTRACT_NAME).wasm $(PIO_HOME)