2020-12-16 21:20:11 +02:00
|
|
|
.PHONY: prebuild clean cleanall server server-mac server-linux server-win server-linux-package generate watch-server webapp mac-app win-app linux-app
|
|
|
|
|
|
|
|
PACKAGE_FOLDER = octo
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
all: server
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
prebuild:
|
|
|
|
go get github.com/gorilla/mux
|
|
|
|
go get github.com/gorilla/websocket
|
|
|
|
go get github.com/spf13/viper
|
|
|
|
go get github.com/lib/pq
|
|
|
|
go get github.com/mattn/go-sqlite3
|
2020-11-04 00:37:29 +02:00
|
|
|
cd webapp; npm install
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
server:
|
2020-10-17 20:48:54 +02:00
|
|
|
cd server; go build -o ../bin/octoserver ./main
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-11-07 20:50:34 +02:00
|
|
|
server-mac:
|
|
|
|
mkdir -p bin/mac
|
|
|
|
cd server; env GOOS=darwin GOARCH=amd64 go build -o ../bin/mac/octoserver ./main
|
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
server-linux:
|
2020-11-07 20:50:34 +02:00
|
|
|
mkdir -p bin/linux
|
|
|
|
cd server; env GOOS=linux GOARCH=amd64 go build -o ../bin/linux/octoserver ./main
|
2020-10-20 20:48:22 +02:00
|
|
|
|
2020-11-07 20:50:34 +02:00
|
|
|
server-win:
|
2021-01-06 20:22:54 +02:00
|
|
|
cd server; env GOOS=windows GOARCH=amd64 go build -o ../bin/win/octoserver.exe ./main
|
2020-11-04 00:37:29 +02:00
|
|
|
|
2020-12-16 21:20:11 +02:00
|
|
|
server-linux-package: server-linux webapp
|
|
|
|
rm -rf package
|
|
|
|
mkdir -p package/${PACKAGE_FOLDER}/bin
|
2021-01-06 20:12:32 +02:00
|
|
|
cp bin/linux/octoserver package/${PACKAGE_FOLDER}/bin
|
2020-12-16 21:20:11 +02:00
|
|
|
cp -R webapp/pack package/${PACKAGE_FOLDER}/pack
|
|
|
|
cp config.json package/${PACKAGE_FOLDER}
|
|
|
|
mkdir -p dist
|
|
|
|
cd package && tar -czvf ../dist/octo-linux-amd64.tar.gz ${PACKAGE_FOLDER}
|
|
|
|
rm -rf package
|
|
|
|
|
2020-10-18 01:17:17 +02:00
|
|
|
generate:
|
2020-10-21 09:56:03 +02:00
|
|
|
cd server; go get -modfile=go.tools.mod github.com/golang/mock/mockgen
|
|
|
|
cd server; go get -modfile=go.tools.mod github.com/jteeuwen/go-bindata
|
2020-10-18 01:17:17 +02:00
|
|
|
cd server; go generate ./...
|
|
|
|
|
2020-10-21 09:59:02 +02:00
|
|
|
server-lint:
|
|
|
|
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
|
|
|
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2020-10-22 13:34:42 +02:00
|
|
|
cd server; golangci-lint run -p format -p unused -p complexity -p bugs -p performance -E asciicheck -E depguard -E dogsled -E dupl -E funlen -E gochecknoglobals -E gochecknoinits -E goconst -E gocritic -E godot -E godox -E goerr113 -E goheader -E golint -E gomnd -E gomodguard -E goprintffuncname -E gosimple -E interfacer -E lll -E misspell -E nlreturn -E nolintlint -E stylecheck -E unconvert -E whitespace -E wsl --skip-dirs services/store/sqlstore/migrations/ ./...
|
2020-10-21 09:59:02 +02:00
|
|
|
|
2020-10-21 22:23:01 +02:00
|
|
|
server-test:
|
|
|
|
cd server; go test ./...
|
|
|
|
|
2020-10-22 13:34:42 +02:00
|
|
|
server-doc:
|
|
|
|
cd server; go doc ./...
|
|
|
|
|
2020-10-16 19:20:43 +02:00
|
|
|
watch-server:
|
|
|
|
cd server; modd
|
|
|
|
|
2020-10-29 11:03:48 +02:00
|
|
|
webapp:
|
|
|
|
cd webapp; npm run pack
|
|
|
|
|
2020-11-07 20:50:34 +02:00
|
|
|
mac-app: server-mac webapp
|
2020-10-26 21:45:40 +02:00
|
|
|
rm -rf mac/resources/bin
|
|
|
|
rm -rf mac/resources/pack
|
2020-11-07 20:50:34 +02:00
|
|
|
mkdir -p mac/resources/bin
|
|
|
|
cp bin/mac/octoserver mac/resources/bin/octoserver
|
2020-10-26 21:45:40 +02:00
|
|
|
cp -R webapp/pack mac/resources/pack
|
|
|
|
mkdir -p mac/temp
|
2021-01-06 21:48:02 +02:00
|
|
|
xcodebuild archive -workspace mac/Tasks.xcworkspace -scheme Tasks -archivePath mac/temp/tasks.xcarchive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGNING_ALLOWED="NO"
|
|
|
|
cp -R mac/temp/tasks.xcarchive/Products/Applications/Tasks.app mac/dist/
|
|
|
|
# xcodebuild -exportArchive -archivePath mac/temp/tasks.xcarchive -exportPath mac/dist -exportOptionsPlist mac/export.plist
|
2020-11-07 20:50:34 +02:00
|
|
|
cd mac/dist; zip -r tasks-mac.zip Tasks.app
|
2020-10-26 21:45:40 +02:00
|
|
|
|
2020-11-07 20:50:34 +02:00
|
|
|
win-app: server-win webapp
|
2020-11-04 00:37:29 +02:00
|
|
|
cd win; make build
|
2020-11-04 02:12:39 +02:00
|
|
|
mkdir -p win/dist/bin
|
2021-01-06 20:22:54 +02:00
|
|
|
cp -R bin/win/octoserver.exe win/dist/bin
|
2020-11-04 00:37:29 +02:00
|
|
|
cp -R config.json win/dist
|
|
|
|
mkdir -p win/dist/webapp
|
|
|
|
cp -R webapp/pack win/dist/webapp/pack
|
|
|
|
# cd win/dist; zip -r ../tasks-win.zip .
|
|
|
|
|
2020-10-29 11:03:48 +02:00
|
|
|
linux-app: server-linux webapp
|
|
|
|
rm -rf linux/temp
|
2020-11-04 01:04:04 +02:00
|
|
|
mkdir -p linux/temp/tasks-app/webapp
|
2020-10-29 11:03:48 +02:00
|
|
|
mkdir -p linux/dist
|
2020-11-07 20:50:34 +02:00
|
|
|
cp -R bin/linux/octoserver linux/temp/tasks-app/
|
2020-11-04 01:04:04 +02:00
|
|
|
cp -R config.json linux/temp/tasks-app/
|
|
|
|
cp -R webapp/pack linux/temp/tasks-app/webapp/pack
|
2020-10-29 11:03:48 +02:00
|
|
|
cd linux; make build
|
2020-11-04 01:04:04 +02:00
|
|
|
cp -R linux/bin/tasks-app linux/temp/tasks-app/
|
|
|
|
cd linux/temp; tar -zcf ../dist/tasks-linux.tar.gz tasks-app
|
2020-10-29 11:03:48 +02:00
|
|
|
rm -rf linux/temp
|
|
|
|
|
2020-10-08 18:21:27 +02:00
|
|
|
clean:
|
|
|
|
rm -rf bin
|
|
|
|
rm -rf dist
|
2020-10-20 20:48:22 +02:00
|
|
|
rm -rf webapp/pack
|
2020-10-26 21:45:40 +02:00
|
|
|
rm -rf mac/temp
|
|
|
|
rm -rf mac/dist
|
2020-11-07 20:50:34 +02:00
|
|
|
rm -rf linux/dist
|
|
|
|
rm -rf win/dist
|
2020-10-08 18:21:27 +02:00
|
|
|
|
|
|
|
cleanall: clean
|
2020-10-20 20:48:22 +02:00
|
|
|
rm -rf webapp/node_modules
|