forked from metaplex-foundation/metaplex-program-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·46 lines (38 loc) · 1.23 KB
/
build.sh
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
#!/bin/bash
function exists_in_list() {
LIST=$1
DELIMITER=$2
VALUE=$3
echo $LIST | tr "$DELIMITER" '\n' | grep -F -q -x "$VALUE"
}
input=$1
programs="auction-house auctioneer candy-machine fixed-price-sale gumdrop hydra token-entangler"
mkdir -p test-programs
if exists_in_list "$programs" " " $input; then
echo "building $input"
cd $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 $program/program
cargo build-bpf --bpf-out-dir ../../test-programs/
cd ../../
done
#echo "building testing-utils"
#cd 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
elif [[ $input = "rooster" ]]
then
solana program dump -u https://api.mainnet-beta.solana.com Roostrnex2Z9Y2XZC49sFAdZARP8E4iFpEnZC5QJWdz ./test-programs/rooster.so
else
echo "Invalid program name: $input"
exit 1
fi