Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Improved build script
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jun 17, 2017
1 parent 0f6d694 commit e396e5c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 12 deletions.
40 changes: 28 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,62 @@ indent() {
}

echo "Cleaning up old build"

echo "--> Removing build directory"
rm -rfv build 2>&1 | indent

echo
echo "Installing dependencies"

echo "--> go-bindata"
go get -u -v github.com/jteeuwen/go-bindata/... 2>&1 | indent

echo "--> go-bindata-assetfs"
go get -u -v github.com/elazarl/go-bindata-assetfs/... 2>&1 | indent

echo "--> etree"
go get -u -v github.com/beevik/etree 2>&1 | indent

echo "--> go-zglob"
go get -u -v github.com/mattn/go-zglob 2>&1 | indent

echo "--> resize"
go get -u -v github.com/nfnt/resize 2>&1 | indent

echo "--> zipfs"
go get -u -v golang.org/x/tools/godoc/vfs/zipfs 2>&1 | indent

echo
echo "Building"

echo "--> Creating build directory"
mkdir -vp build 2>&1 | indent
echo "--> Generating bindata"
go-bindata-assetfs static/... 2>&1 | indent

echo "Generating bindata"
go generate

echo "--> Building BookBrowser for Linux 64bit"
env GOOS=linux GOARCH=amd64 go build -o build/BookBrowser-linux-64bit 2>&1 | indent

if [[ "$1" == "all" ]]; then
echo "--> Building BookBrowser for Linux 32bit"
env GOOS=linux GOARCH=386 go build -o build/BookBrowser-linux-32bit 2>&1 | indent
echo "--> Building BookBrowser for Windows 64bit"
env GOOS=windows GOARCH=amd64 go build -o build/BookBrowser-windows-64bit.exe 2>&1 | indent
echo "--> Building BookBrowser for Windows 32bit"
env GOOS=windows GOARCH=386 go build -o build/BookBrowser-windows-32bit.exe 2>&1 | indent
echo "--> Building BookBrowser for Darwin 64bit"
env GOOS=darwin GOARCH=amd64 go build -o build/BookBrowser-darwin-64bit 2>&1 | indent
echo "--> Building BookBrowser for Darwin 32bit"
env GOOS=darwin GOARCH=386 go build -o build/BookBrowser-darwin-32bit 2>&1 | indent
echo "--> Building BookBrowser for Linux 32bit"
env GOOS=linux GOARCH=386 go build -o build/BookBrowser-linux-32bit 2>&1 | indent

echo "--> Building BookBrowser for Windows 64bit"
env GOOS=windows GOARCH=amd64 go build -o build/BookBrowser-windows-64bit.exe 2>&1 | indent

echo "--> Building BookBrowser for Windows 32bit"
env GOOS=windows GOARCH=386 go build -o build/BookBrowser-windows-32bit.exe 2>&1 | indent

echo "--> Building BookBrowser for Darwin 64bit"
env GOOS=darwin GOARCH=amd64 go build -o build/BookBrowser-darwin-64bit 2>&1 | indent

echo "--> Building BookBrowser for Darwin 32bit"
env GOOS=darwin GOARCH=386 go build -o build/BookBrowser-darwin-32bit 2>&1 | indent
fi

echo

echo "Cleaning up"
echo "--> Removing bindata"
rm -rfv bindata_assetfs.go 2>&1 | indent
Expand Down
Binary file removed build/BookBrowser-darwin-32bit.exe
Binary file not shown.
Binary file removed build/BookBrowser-darwin-64bit.exe
Binary file not shown.
Binary file removed build/BookBrowser-linux-32bit
Binary file not shown.
Binary file removed build/BookBrowser-linux-64bit
Binary file not shown.
Binary file removed build/BookBrowser-windows-32bit.exe
Binary file not shown.
Binary file removed build/BookBrowser-windows-64bit.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package main

//go:generate go-bindata-assetfs static/...

import (
"bytes"
"fmt"
Expand Down

0 comments on commit e396e5c

Please sign in to comment.