forked from XTLS/libXray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
41 lines (35 loc) · 711 Bytes
/
build.sh
File metadata and controls
41 lines (35 loc) · 711 Bytes
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
#!/bin/bash
prepare_go() {
rm -f go.mod
rm -f go.sum
go mod init github.com/xtls/libxray
go mod tidy
}
prepare_gomobile() {
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
go get -d golang.org/x/mobile/cmd/gomobile
}
build_apple() {
rm -fr *.xcframework
prepare_gomobile
gomobile bind -target ios,iossimulator,macos -iosversion 15.0
}
build_android() {
rm -fr *.jar
rm -fr *.aar
prepare_gomobile
gomobile bind -target android -androidapi 28
}
download_geo() {
go run main/main.go
}
echo "will build libxray for $1"
prepare_go
download_geo
if [ "$1" != "apple" ]; then
build_android
else
build_apple
fi
echo "build libxray done"