-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathjustfile
118 lines (96 loc) · 2.89 KB
/
justfile
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Prints the list of recipes.
default:
@just --list
# Builds the whole project with the a feature flag if provided.
build FEATURE='':
#!/usr/bin/env sh
echo "-- Building {{FEATURE}} -- \n"
if [ -z "{{FEATURE}}" ]; then
cargo build
else
cargo build --features {{FEATURE}}
fi
# Build all schemas
schemas:
scripts/build_schemas.sh
# Tests the whole project with the a feature flag if provided.
test FEATURE='':
#!/usr/bin/env sh
if [ -z "{{FEATURE}}" ]; then
cargo test
else
cargo test --features {{FEATURE}}
fi
# Alias to the format recipe.
fmt:
@just format
# Formats the rust, toml and sh files in the project.
format:
cargo fmt --all
find . -type f -iname "*.toml" -print0 | xargs -0 taplo format
find . -type f -name '*.sh' -exec shfmt -w {} \;
# Runs clippy with the a feature flag if provided.
lint FEATURE='':
#!/usr/bin/env sh
if [ -z "{{FEATURE}}" ]; then
cargo clippy --all -- -D warnings
else
cargo clippy --features {{FEATURE}} --all -- -D warnings
fi
# Tries to fix clippy issues automatically.
lintfix:
cargo clippy --fix --allow-staged --allow-dirty --all-features
just format
# Checks the whole project with all the feature flags.
check-all:
cargo check --all-features
# Cargo check.
check:
cargo check
# Cargo clean and update.
refresh:
cargo clean && cargo update
# Cargo watch.
watch:
cargo watch -x lcheck
# Watches tests with the a feature flag if provided.
watch-test FEATURE='':
#!/usr/bin/env sh
if [ -z "{{FEATURE}}" ]; then
cargo watch -x "nextest run"
else
cargo watch -x "nextest run --features {{FEATURE}}"
fi
# Compiles and optimizes the contracts for the specified chain.
optimize CHAIN:
scripts/build_release.sh -c {{CHAIN}}
# Prints the artifacts versions on the current commit.
get-artifacts-versions:
scripts/get_artifacts_versions.sh
# Prints the artifacts size. Optimize should be called before.
get-artifacts-size:
scripts/check_artifacts_size.sh
# Extracts the pools from the given chain.
get-pools CHAIN:
scripts/deployment/extract_pools.sh -c {{CHAIN}}
# Installs the env loader locally.
install-env-loader:
scripts/deployment/deploy_env/add_load_chain_env_alias.sh
# Deploys the contracts to the specified chain.
deploy CHAIN ARTIFACT='all':
scripts/deployment/deploy_liquidity_hub.sh -c {{CHAIN}} -d {{ARTIFACT}}
# Stores the contracts to the specified chain.
store CHAIN ARTIFACT='all':
scripts/deployment/deploy_liquidity_hub.sh -c {{CHAIN}} -s {{ARTIFACT}}
# Migrates the contracts to the specified chain.
migrate CHAIN ARTIFACT='all':
scripts/deployment/migrate_liquidity_hub.sh -c {{CHAIN}} -m {{ARTIFACT}}
# Alias to the rename-a64-artifacts recipe.
rename-artifacts:
@just rename-a64-artifacts
# Renames the artifacts from *-aarch64.wasm to *.wasm.
rename-a64-artifacts:
#!/usr/bin/env sh
for file in artifacts/*-aarch64*.wasm; do
mv "$file" "${file/-aarch64/}"
done