-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 988 Bytes
/
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
#!/usr/bin/make -f
CONTAINER_RUNTIME := $(shell which docker 2>/dev/null || which podman 2>/dev/null)
### Recommended image for ARM64 processors: https://hub.docker.com/r/cosmwasm/rust-optimizer-arm64
OPTIMIZER_IMAGE := cosmwasm/optimizer
OPTIMIZER_DOCKER_TAG := 0.16.1
.PHONY: all
all: fmt build test lint schema
.PHONY: fmt
fmt:
@cargo fmt --all -- --check
.PHONY: build
build:
@cargo wasm
.PHONY: unit-test
unit-test:
@RUST_BACKTRACE=1 cargo unit-test
.PHONY: doc-test
doc-test:
@RUST_BACKTRACE=1 cargo doc-test
.PHONY: test
test: unit-test doc-test
.PHONY: lint
lint:
@cargo clippy -- -D warnings
.PHONY: schema
schema:
@cargo schema
.PHONY: optimize
optimize:
$(CONTAINER_RUNTIME) run --rm -v $(CURDIR):/code:Z \
--mount type=volume,source=asset-classification-smart-contract_cache,target=/code/target \
--mount type=volume,source=asset-classification-smart-contract_registry_cache,target=/usr/local/cargo/registry \
$(OPTIMIZER_IMAGE):$(OPTIMIZER_DOCKER_TAG)