1 Star 0 Fork 424

迷途の日记/go-admin

forked from go-admin/go-admin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 5.32 KB
一键复制 编辑 原始数据 按行查看 历史
honkui 提交于 2020-01-31 10:55 . ready for v1.1.9
GOCMD=go
GOBUILD=$(GOCMD) build
BINARY_NAME=adm
LASTVERSION=v1.1.8
VERSION=v1.1.9
CLI=adm
TEST_CONFIG_PATH=./../common/config.json
TEST_CONFIG_PQ_PATH=./../common/config_pg.json
TEST_CONFIG_SQLITE_PATH=./../common/config_sqlite.json
all: run
tmpl:
$(CLI) compile tpl
fmt:
go fmt ./adapter/...
go fmt ./adm/...
go fmt ./context/...
go fmt ./engine/...
go fmt ./tests/...
go fmt ./examples/...
go fmt ./modules/...
go fmt ./plugins/...
go fmt ./template/...
golint:
golint ./adapter/...
golint ./adm/...
golint ./context/...
golint ./engine/...
golint ./tests/...
golint ./examples/...
golint ./modules/...
golint ./plugins/...
golint ./template/...
govet:
go vet ./adapter/...
go vet ./adm/...
go vet ./context/...
go vet ./engine/...
go vet ./tests/...
go vet ./examples/...
go vet ./modules/...
go vet ./plugins/...
go vet ./template/...
deps:
go get github.com/kardianos/govendor
govendor sync
test:
go get github.com/ugorji/go/codec@none
make mysql-test
make pg-test
make sqlite-test
mysql-test:
make import-mysql
gotest -v ./tests/gin/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/beego/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/buffalo/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/chi/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/echo/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/gorilla/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/gf/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/fasthttp/... -args $(TEST_CONFIG_PATH)
sqlite-test:
make import-sqlite
gotest -v ./tests/gin/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/beego/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/buffalo/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/chi/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/echo/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/gorilla/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/gf/... -args $(TEST_CONFIG_SQLITE_PATH)
make import-sqlite
gotest -v ./tests/fasthttp/... -args $(TEST_CONFIG_SQLITE_PATH)
import-sqlite:
rm -rf ./tests/common/admin.db
cp ./data/admin.db ./tests/common/admin.db
import-mysql:
mysql -uroot -proot -e "create database if not exists \`go-admin-test\`"
mysql -uroot -proot go-admin-test < ./data/admin.sql
import-postgresql:
dropdb -U postgres go-admin-test
createdb -U postgres go-admin-test
psql -d go-admin-test -U postgres -f ./data/admin.pgsql
pg-test:
make import-postgresql
gotest -v ./tests/gin/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/beego/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/buffalo/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/chi/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/echo/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/gorilla/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/gf/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/fasthttp/... -args $(TEST_CONFIG_PQ_PATH)
fix-gf:
go get -u -v github.com/gogf/gf@v1.9.10
sudo echo "\nfunc (s *Server) DefaultHttpHandle(w http.ResponseWriter, r *http.Request) { \n s.handleRequest(w, r) \n}\n" >> $(GOPATH)/pkg/mod/github.com/gogf/gf@v1.9.10/net/ghttp/ghttp_server_handler.go
lint:
make golint
make govet
golangci-lint run
cli:
GO111MODULE=on $(GOBUILD) -ldflags "-w" -o ./adm/build/mac/$(BINARY_NAME) ./adm/...
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./adm/build/linux/x86_64/$(BINARY_NAME) ./adm/...
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=arm $(GOBUILD) -o ./adm/build/linux/armel/$(BINARY_NAME) ./adm/...
GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o ./adm/build/windows/x86_64/$(BINARY_NAME).exe ./adm/...
GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=386 $(GOBUILD) -o ./adm/build/windows/i386/$(BINARY_NAME).exe ./adm/...
rm -rf ./adm/build/linux/armel/adm_linux_armel_$(LASTVERSION).zip
rm -rf ./adm/build/linux/x86_64/adm_linux_x86_64_$(LASTVERSION).zip
rm -rf ./adm/build/windows/x86_64/adm_windows_x86_64_$(LASTVERSION).zip
rm -rf ./adm/build/windows/i386/adm_windows_i386_$(LASTVERSION).zip
rm -rf ./adm/build/mac/adm_darwin_x86_64_$(LASTVERSION).zip
zip -qj ./adm/build/linux/armel/adm_linux_armel_$(VERSION).zip ./adm/build/linux/armel/adm
zip -qj ./adm/build/linux/x86_64/adm_linux_x86_64_$(VERSION).zip ./adm/build/linux/x86_64/adm
zip -qj ./adm/build/windows/x86_64/adm_windows_x86_64_$(VERSION).zip ./adm/build/windows/x86_64/adm.exe
zip -qj ./adm/build/windows/i386/adm_windows_i386_$(VERSION).zip ./adm/build/windows/i386/adm.exe
zip -qj ./adm/build/mac/adm_darwin_x86_64_$(VERSION).zip ./adm/build/mac/adm
rm -rf ./adm/build/zip/*
cp ./adm/build/linux/armel/adm_linux_armel_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/linux/x86_64/adm_linux_x86_64_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/windows/x86_64/adm_windows_x86_64_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/windows/i386/adm_windows_i386_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/mac/adm_darwin_x86_64_$(VERSION).zip ./adm/build/zip/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mitu1993/go-admin.git
git@gitee.com:mitu1993/go-admin.git
mitu1993
go-admin
go-admin
master

搜索帮助