2022-06-16 09:48:01 -07:00
|
|
|
SOURCE_FILES=$(shell find . -name "*.rs" -or -name "*.lock" -or -name "*.toml" | grep -v target)
|
|
|
|
PACKAGES=$(shell find . -name "Cargo.toml" | grep -E 'packages|contracts' | xargs cat | grep "name *=" | cut -d' ' -f3 | sed s/\"//g | sed s/-/_/g)
|
|
|
|
WASMS=$(patsubst %, artifacts/%.wasm, $(PACKAGES))
|
|
|
|
|
|
|
|
-include ../Makefile.help
|
|
|
|
|
|
|
|
.PHONY: artifacts
|
|
|
|
## Build contracts.
|
|
|
|
artifacts: artifacts/checksums.txt
|
|
|
|
|
|
|
|
$(WASMS) artifacts/checksums.txt: $(SOURCE_FILES)
|
2022-12-21 05:44:57 -08:00
|
|
|
DOCKER_BUILDKIT=1 docker build --target artifacts -o artifacts -f ./Dockerfile ../
|
2022-06-16 09:48:01 -07:00
|
|
|
|
|
|
|
tools/node_modules: tools/package-lock.json
|
|
|
|
cd tools && npm ci
|
|
|
|
|
2022-12-12 15:43:22 -08:00
|
|
|
.PHONY: test
|
2022-06-16 09:48:01 -07:00
|
|
|
## Run unit tests
|
2022-12-12 15:43:22 -08:00
|
|
|
test:
|
|
|
|
cargo test --workspace --locked
|
2022-06-16 09:48:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(WASMS)
|
|
|
|
rm -f artifacts/checksums.txt
|