-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
58 lines (43 loc) · 1.43 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
57
58
.PHONY: init candid build idl build-ic-test build-ic-production local stop-replica test deploy-ic-test deploy-ic-production format lint clean
LOCAL_ADMIN_PRINCIPAL=$(shell dfx identity get-principal)
TEST_ADMIN_PRINCIPAL=$(shell cat test/admin-test-principal)
init:
npm --prefix test i
cargo check
candid:
cargo run > cover.did
build: candid
dfx ping local || dfx start --clean --background
dfx canister create cover
dfx build cover
idl: build
echo "// @ts-nocheck" > test/idl/cover.did.ts
cat .dfx/local/canisters/cover/cover.did.js >> test/idl/cover.did.ts
cp .dfx/local/canisters/cover/cover.did.d.ts test/idl/cover.did.d.ts
build-ic-test:
dfx build --network ic cover_test
build-ic-production:
dfx build --network ic cover
local: build
dfx deploy cover --argument '(opt record{admin=opt vec{principal"$(LOCAL_ADMIN_PRINCIPAL)"}})'
stop-replica:
dfx stop
test: stop-replica idl
dfx canister install cover --argument '(opt record{admin=opt vec{principal"$(TEST_ADMIN_PRINCIPAL)"}})'
npm --prefix test t
dfx stop
deploy-ic-test:
dfx canister --network ic install cover_test -m upgrade
deploy-ic-production:
dfx canister --network ic install cover -m upgrade
format:
npm --prefix test run prettier
npm --prefix test run lint
cargo fmt --all
lint:
npm --prefix test run prebuild
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings -D clippy::all
clean:
cargo clean
npm --prefix test run clean