-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
78 lines (63 loc) · 3.3 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
CARGO = cargo
.PHONY = res/bridge_token.wasm res/bridge_token_factory.wasm res/rainbow_bridge_near_token_locker.wasm res/bridge_token_no_icon.wasm res/bridge_token_factory_no_icon.wasm res/ERC20MetadataLogger.json
all: res/bridge_token.wasm res/bridge_token_factory.wasm res/rainbow_bridge_near_token_locker.wasm res/ERC20MetadataLogger.json
prepare:
rustup target add wasm32-unknown-unknown
res/bridge_token.wasm: $(shell find bridge-token/src -name "*.rs")
cd bridge-token && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release && \
cp target/wasm32-unknown-unknown/release/bridge_token.wasm ../res/ && \
ls -l ../res/bridge_token.wasm
res/bridge_token_factory.wasm: export BRIDGE_TOKEN = $(realpath res/bridge_token.wasm)
res/bridge_token_factory.wasm: res/bridge_token.wasm $(shell find bridge-token-factory/src -name "*.rs")
cd bridge-token-factory && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release && \
cp target/wasm32-unknown-unknown/release/bridge_token_factory.wasm ../res/ && \
ls -l ../res/bridge_token_factory.wasm
res/rainbow_bridge_near_token_locker.wasm: $(shell find token-locker/src -name "*.rs")
cd token-locker && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release && \
cp target/wasm32-unknown-unknown/release/rainbow_bridge_near_token_locker.wasm ../res/ && \
ls -l ../res/rainbow_bridge_near_token_locker.wasm
res/ERC20MetadataLogger.json: metadata-connector/contracts/ERC20MetadataLogger.sol
cd metadata-connector && \
yarn && \
yarn compile && \
cp artifacts/contracts/ERC20MetadataLogger.sol/ERC20MetadataLogger.json ../res/ && \
ls -l ../res/ERC20MetadataLogger.json
test: export BRIDGE_TOKEN = $(realpath res/bridge_token.wasm)
test:
rustup install 1.70.0 && \
cd bridge-token-factory && \
cargo +1.70.0 test --all
test-token-locker:
cd token-locker && \
cargo test --all
test-token-silo-to-silo:
cd silo-to-silo && \
yarn && \
cd integration-tests && \
rustup target add wasm32-unknown-unknown && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release --manifest-path mock_token/Cargo.toml && \
cargo test --all --jobs 4 -- --test-threads 4
# <--
# For testing purposes only (can be removed at any moment)
no_icon: res/bridge_token_no_icon.wasm res/bridge_token_factory_no_icon.wasm
res/bridge_token_no_icon.wasm: $(shell find bridge-token/src -name "*.rs")
cd bridge-token && \
export RUSTFLAGS='-C link-arg=-s' && \
BRIDGE_TOKEN=$(realpath ../res/bridge_token.wasm) $(CARGO) build --target wasm32-unknown-unknown --no-default-features --release && \
cp target/wasm32-unknown-unknown/release/bridge_token.wasm ../res/bridge_token_no_icon.wasm && \
ls -l ../res/bridge_token_no_icon.wasm
res/bridge_token_factory_no_icon.wasm: export BRIDGE_TOKEN=$(realpath res/bridge_token_no_icon.wasm)
res/bridge_token_factory_no_icon.wasm: res/bridge_token_no_icon.wasm $(shell find bridge-token-factory/src -name "*.rs")
cd bridge-token-factory && \
export RUSTFLAGS='-C link-arg=-s' && \
$(CARGO) build --target wasm32-unknown-unknown --release && \
cp target/wasm32-unknown-unknown/release/bridge_token_factory.wasm ../res/bridge_token_factory_no_icon.wasm && \
ls -l ../res/bridge_token_factory_no_icon.wasm
# -->