-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregen.sh
43 lines (36 loc) · 1.02 KB
/
regen.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
#!/bin/bash -xe
echo "**************************************"
echo "***** QUICLY-GO BINDINGS REGEN *****"
echo "**************************************"
echo
function assert_errorcode() {
if [[ ! "$?" -eq "0" ]]; then
echo "********************************"
echo "**** RESULT: FAILURE ****"
echo "********************************"
exit 1
fi
}
BASEDIR=$(dirname "$(realpath $0)")
OSNAME=$(go env GOOS)
echo [Prerequisites check: C_FOR_GO]
c-for-go -h
if [[ ! "$?" -eq "0" ]]; then
echo [Build C-FOR-GO]
cd deps/c-for-go
go install -v
assert_errorcode
fi
cd $BASEDIR
echo [Regen Errors package]
c-for-go -nostamp -nocgo -debug -ccdefs -ccincl -path "$BASEDIR" -out quiclylib genspec/errors.$OSNAME.yml
assert_errorcode
echo [Regen Quicly Bindings package]
c-for-go -nostamp -debug -ccdefs -ccincl -path "$BASEDIR" -out internal genspec/bindings.$OSNAME.yml
assert_errorcode
echo
echo "***************************"
echo "**** RESULT: SUCCESS ****"
echo "***************************"
cd $BASEDIR
exit 0