Gemini proxy for Android
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
1.0 KiB

#!/bin/bash
export PROJECTPATH=$PWD
export GOPATH="$PROJECTPATH/go"
export GO111MODULE=off
if [ -z "$1" ]; then
echo "Usage: ./bind.sh <gmitohtml commit hash>"
exit 1
fi
echo "Downloading gomobile..."
GOPATH="$PROJECTPATH/go" go get -u golang.org/x/mobile/cmd/...
echo "Downloading gmitohtml $1..."
mkdir -p $GOPATH/src/code.rocketnine.space/tslocum
if [ ! -d "$GOPATH/src/code.rocketnine.space/tslocum/gmitohtml" ]; then
git clone https://code.rocketnine.space/tslocum/gmitohtml $GOPATH/src/code.rocketnine.space/tslocum/gmitohtml
fi
cd $GOPATH/src/code.rocketnine.space/tslocum/gmitohtml && git fetch origin && git reset --hard `printf %q "$1"` && cd $PROJECTPATH
#echo "Downloading dependencies..."
#cd $GOPATH/src/code.rocketnine.space/tslocum/gmitohtml
#go mod vendor
#cd $PROJECTPATH
echo "Binding library..."
mkdir -p libs
PATH="$PROJECTPATH/go/bin:$PATH"
$GOPATH/bin/gomobile bind -javapkg space.rocketnine -o libs/gmitohtml.aar -target=android -androidapi=16 $GOPATH/src/code.rocketnine.space/tslocum/gmitohtml/pkg/gmitohtml
echo "Finished."