2018-03-20 01:51:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export BUILD_BASE=build
|
|
|
|
|
2018-03-20 05:29:19 +00:00
|
|
|
function get_go_ver(){
|
|
|
|
GOVER=`go version|awk '{print $3}'`
|
|
|
|
export GOVER
|
|
|
|
}
|
|
|
|
|
2018-03-20 01:51:10 +00:00
|
|
|
function get_os() {
|
|
|
|
OS=`uname|tr '[:upper:]' '[:lower:]'`
|
|
|
|
if [ "${GOOS}x" != "x" ]; then
|
|
|
|
OS=$GOOS
|
|
|
|
fi
|
|
|
|
export OS
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_darwin() {
|
|
|
|
export INSTALL_TARGET=$BUILD_BASE/Arremi.app/Contents/
|
|
|
|
mkdir -p $INSTALL_TARGET/MacOS
|
|
|
|
go build -o $INSTALL_TARGET/MacOS/Arremi main.go
|
2018-03-20 03:41:03 +00:00
|
|
|
mkdir -p $INSTALL_TARGET/Resources
|
|
|
|
(cd assets/darwin/ && iconutil --convert icns Arremi.iconset --file ../../$INSTALL_TARGET/Resources/Arremi.icns)
|
2018-03-20 03:43:50 +00:00
|
|
|
cp assets/darwin/Info.plist $INSTALL_TARGET
|
2018-03-20 01:51:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function build_linux() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function main() {
|
2018-03-20 03:56:03 +00:00
|
|
|
rm -rf build
|
2018-03-20 01:51:10 +00:00
|
|
|
mkdir -p $BUILD_BASE
|
|
|
|
get_os
|
2018-03-20 05:29:19 +00:00
|
|
|
get_go_ver
|
|
|
|
if [ $GOVER == 'go1.10' ]; then
|
|
|
|
export CGO_LDFLAGS_ALLOW=".*"
|
|
|
|
fi
|
|
|
|
case $OS
|
2018-03-20 01:51:10 +00:00
|
|
|
darwin)
|
2018-03-20 03:41:03 +00:00
|
|
|
build_darwin
|
2018-03-20 01:51:10 +00:00
|
|
|
;;
|
|
|
|
linux)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "No target"
|
|
|
|
;;
|
|
|
|
esac
|
2018-03-20 02:31:08 +00:00
|
|
|
}
|