mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-27 21:55:07 +03:00
Move src/mobile
into main repository (#864)
* Move `src/mobile` into main repository * Update go.mod/go.sum * Move to `contrib`, separate mobile build script
This commit is contained in:
parent
a4bdf3de32
commit
6d92edd405
9 changed files with 339 additions and 30 deletions
32
build
32
build
|
@ -9,13 +9,11 @@ PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
|
|||
LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
|
||||
ARGS="-v"
|
||||
|
||||
while getopts "uaitc:l:dro:p" option
|
||||
while getopts "utc:l:dro:p" option
|
||||
do
|
||||
case "$option"
|
||||
in
|
||||
u) UPX=true;;
|
||||
i) IOS=true;;
|
||||
a) ANDROID=true;;
|
||||
t) TABLES=true;;
|
||||
c) GCFLAGS="$GCFLAGS $OPTARG";;
|
||||
l) LDFLAGS="$LDFLAGS $OPTARG";;
|
||||
|
@ -30,25 +28,11 @@ if [ -z $TABLES ] && [ -z $DEBUG ]; then
|
|||
LDFLAGS="$LDFLAGS -s -w"
|
||||
fi
|
||||
|
||||
if [ $IOS ]; then
|
||||
echo "Building framework for iOS"
|
||||
go get golang.org/x/mobile/bind
|
||||
gomobile bind -target ios -tags mobile -o Yggdrasil.framework -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" \
|
||||
github.com/yggdrasil-network/yggdrasil-extras/src/mobile \
|
||||
github.com/yggdrasil-network/yggdrasil-go/src/config
|
||||
elif [ $ANDROID ]; then
|
||||
echo "Building aar for Android"
|
||||
go get golang.org/x/mobile/bind
|
||||
gomobile bind -target android -tags mobile -o yggdrasil.aar -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" \
|
||||
github.com/yggdrasil-network/yggdrasil-extras/src/mobile \
|
||||
github.com/yggdrasil-network/yggdrasil-go/src/config
|
||||
else
|
||||
for CMD in yggdrasil yggdrasilctl ; do
|
||||
echo "Building: $CMD"
|
||||
go build $ARGS -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" ./cmd/$CMD
|
||||
for CMD in yggdrasil yggdrasilctl ; do
|
||||
echo "Building: $CMD"
|
||||
go build $ARGS -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" ./cmd/$CMD
|
||||
|
||||
if [ $UPX ]; then
|
||||
upx --brute $CMD
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ $UPX ]; then
|
||||
upx --brute $CMD
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue