-
Notifications
You must be signed in to change notification settings - Fork 1
/
bdk-rep-buil
executable file
·173 lines (131 loc) · 3.33 KB
/
bdk-rep-buil
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/sh
set -e
bdkrepbuild__build() {
if [ -z "$2" ]; then
echo "❌ You did not specify a build target! ❌"
usage="
USAGE
$ ./bdk-rep-build build <target>
EXAMPLE
$ ./bdk-rep-build build linux"
echo "$usage"
exit 1 # Exit script with error code
fi
case "$2" in
"android" | "linux" | "macos" | "ios")
;;
*)
echo "❌ Error: $2 is not a supported target. ❌"
supported_targets="
Supported targets are:
- linux
- android
- macos
- ios "
echo "$supported_targets"
exit 1
;;
esac
target=$2
export target
. "./$target.sh"
}
bdkrepbuild__help_build(){
help="
Create a build for specific target
USAGE
$ ./bdk-rep-build build <target>
EXAMPLE
$ ./bdk-rep-build build linux
"
echo "$help"
}
bdkrepbuild__verify(){
if [ -z "$2" ]; then
echo "❌ You did not specify a target to verify! ❌"
usage="
USAGE
$ ./bdk-rep-build verify <target>
EXAMPLE
$ ./bdk-rep-build verify linux"
echo "$usage"
exit 1 # Exit script with error code
fi
case "$2" in
"android" | "linux" | "macos" | "ios")
;;
*)
echo "❌ Error: $2 is not a supported target you can verify. ❌"
supported_targets="
Supported targets are:
- linux
- android
- macos
- ios"
echo "$supported_targets"
exit 1
;;
esac
target="$2"
export $target
. ./verifier.sh
}
bdkrepbuild__help_verify() {
help="
Verify a build for a specific target
USAGE
$ ./bdk-rep-build verify <target>
EXAMPLE
$ ./bdk-rep-build verify linux
"
echo "$help"
}
bdkrepbuild__help(){
if [ $# -eq 2 ]; then
call "bdkrepbuild__$1_$2" "$@"
exit 0
fi
help="
____ ____ _ __ ____ _____ ____ ____ _ _ ___ _ ____
| __ )| _ \| |/ / | _ \| ____| _ \ | __ )| | | |_ _| | | _ \
| _ \| | | | ' /_____| |_) | _| | |_) |____| _ \| | | || || | | | | |
| |_) | |_| | . \_____| _ <| |___| __/_____| |_) | |_| || || |___| |_| |
|____/|____/|_|\_\ |_| \_\_____|_| |____/ \___/|___|_____|____/
Cross-compile and verify reproducible builds for bdk-rust library.
* To use with : BDK-Flutter, LWK-Dart, BOLTZ-dart
* Targeting: Linux, Android, iOS, MaoOS
USAGE
$ bdk-rep-build [COMMAND]
$ bdk-rep-build help [COMMAND]
COMMANDS
help show help
verify verify build against release
build build artifacts for a target
"
echo "$help"
}
call() {
func=$1
if type "$func" 1>/dev/null 2>&1; then
# if it's bdk_rep_build COMMAND help, then call help for that command
case $3 in
-h|--help|help)
call "bdkrepbuild__help_$2"
exit 0
;;
esac
shift # remove func from args
"$func" "$@" # invoke our named function w/ all remaining arguments
else
# if it's bdk_rep_build -h COMMAND, then call help for that command
case $2 in
-h|--help)
call "bdkrepbuild__help_$3"
exit 0
;;
esac
bdkrepbuild__help
exit 1
fi
}
call "bdkrepbuild__$1" "$@"