Skip to content

Commit 4179790

Browse files
authored
build: use the official golang.org/x/mobile version (#3)
1 parent 940e699 commit 4179790

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# libcore
2+
3+
## Build
4+
5+
```
6+
cd ./scripts/ && bash -x ./build.sh
7+
```

scripts/build.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,21 @@ if [ -z "$GOPATH" ]; then
1111
fi
1212

1313
PATH="$PATH:$GOPATH/bin"
14-
14+
GOMOBILE_VERSION="v0.0.0-20231127183840-76ac6878050a"
1515
# Install gomobile
16-
if [ ! -f "$GOPATH/bin/gomobile-matsuri" ]; then
17-
git clone https://github.com/MatsuriDayo/gomobile ../gomobile
18-
cd ../gomobile
19-
go install -v ./cmd/gomobile/
20-
cd - &>/dev/null && rm -rf ../gomobile
21-
mv -v "$GOPATH/bin/gomobile" "$GOPATH/bin/gomobile-matsuri"
16+
if [ ! -f "$GOPATH/bin/gomobile" ]; then
17+
go get -v "golang.org/x/mobile@$GOMOBILE_VERSION"
18+
go install -v "$GOPATH/pkg/mod/golang.org/x/mobile@$GOMOBILE_VERSION/cmd/gomobile"
2219
fi
2320

24-
gomobile-matsuri init
21+
gomobile init
2522

2623
cd ..
2724

28-
go get -v golang.org/x/mobile@v0.0.0-20231108233038-35478a0c49da
29-
gomobile-matsuri bind -v \
30-
-androidapi 21 \
31-
-trimpath \
32-
-ldflags='-s -w' \
33-
-tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' .
25+
gomobile bind -v \
26+
-androidapi 21 \
27+
-trimpath \
28+
-ldflags='-s -w' \
29+
-tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' .
3430

35-
rm -v "$GOPATH/bin/gomobile-matsuri" "$GOPATH/bin/gobind" libcore-sources.jar
31+
rm -v "$GOPATH/bin/gomobile" "$GOPATH/bin/gobind" libcore-sources.jar

0 commit comments

Comments
 (0)