-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·60 lines (49 loc) · 1.36 KB
/
build.sh
File metadata and controls
executable file
·60 lines (49 loc) · 1.36 KB
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
#!/bin/bash
function exists_in_list() {
LIST=$1
DELIMITER=$2
VALUE=$3
echo $LIST | tr "$DELIMITER" '\n' | grep -F -q -x "$VALUE"
}
programs="token-metadata boync-anchor-program"
input=$1
mkdir -p test-programs
if [[ $input == "clean" ]]; then
echo "Cleaining..."
for program in ${programs}; do
echo "Cleaning $program"
cd programs/$program/program
cargo clean
cd ../../..
done
echo "Deleting test-programs/*.so files"
rm "test-programs/*.so"
echo "Done"
exit 1
fi
if exists_in_list "$programs" " " $input; then
echo "building $input"
cd programs/$input/program
cargo build-bpf --bpf-out-dir ../../../test-programs/
cd ../../
elif [[ $input = "all" ]]
then
echo "building all programs"
for program in ${programs}; do
echo "building $program"
cd programs/$program/program
cargo build-bpf --bpf-out-dir ../../../test-programs/
cd ../../../
done
# echo "building testing-utils"
# echo $PWD
# cd programs/core/rust/testing-utils
# cargo build-bpf --bpf-out-dir ../../../../test-programs/
# cd ../../../../
elif [[ $input = "token-auth-rules" ]]
then
solana program dump -u https://api.mainnet-beta.solana.com auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg ./test-programs/mpl_token_auth_rules.so
else
echo "Invalid program name: $input"
exit 1
fi