Skip to content

Commit 34dac7e

Browse files
committed
build: use sagernet/gomobile and improve build
1 parent efe2c63 commit 34dac7e

2 files changed

Lines changed: 6 additions & 32 deletions

File tree

scripts/build.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,27 @@ set -e
66

77
source $SCRIPT_DIR/env.sh
88

9-
bash $SCRIPT_DIR/sources.sh
10-
119
if [ -z "$GOPATH" ]; then
12-
GOPATH=$(go env GOPATH)
10+
GOPATH=$(go env GOPATH)
1311
fi
1412

1513
PATH="$PATH:$GOPATH/bin"
16-
GOMOBILE_VERSION="v0.0.0-20231127183840-76ac6878050a"
14+
GOMOBILE_URL=github.com/sagernet/gomobile
15+
GOMOBILE_VERSION="v0.1.4"
1716

1817
cd "$SCRIPT_DIR/../"
1918

2019
# Install gomobile
2120
if [ ! -f "$GOPATH/bin/gomobile" ]; then
22-
go get -v "golang.org/x/mobile@$GOMOBILE_VERSION"
23-
go install -v "$GOPATH/pkg/mod/golang.org/x/mobile@$GOMOBILE_VERSION/cmd/gomobile"
21+
go get -v "$GOMOBILE_URL@$GOMOBILE_VERSION"
22+
go install -v "$GOPATH/pkg/mod/$GOMOBILE_URL@$GOMOBILE_VERSION/cmd/gomobile"
2423
fi
2524

2625
gomobile init
2726
gomobile bind -v \
2827
-androidapi 21 \
2928
-trimpath \
30-
-ldflags='-s -w' \
29+
-ldflags='-s -w -buildid=' \
3130
-tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' .
3231

3332
rm -v "$GOPATH/bin/gomobile" "$GOPATH/bin/gobind" "$SCRIPT_DIR/../libcore-sources.jar"

scripts/sources.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)