Adding a Makefile

This commit is contained in:
Deluan 2016-10-10 20:27:09 -04:00
parent 8d54d42404
commit 12e7100325
2 changed files with 42 additions and 6 deletions

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
#@IgnoreInspection BashAddShebang
BINARY=gosonic
SOURCES := $(shell find . -name '*.go')
all: $(BINARY)
$(BINARY): $(SOURCES)
go build
.PHONY: clean
clean:
rm -f ${BINARY}
.PHONY: setup
setup:
go get -u github.com/beego/bee # bee command line tool
go get -u github.com/smartystreets/goconvey # test runnner
go get -u github.com/kardianos/govendor # dependency manager
govendor sync # download all dependencies
.PHONY: run
run:
bee run -e vendor -e tests
.PHONY: test
test:
BEEGO_RUNMODE=test go test `go list ./...|grep -v vendor` -v
.PHONY: convey
convey:
NOLOG=1 goconvey --port 9090 -excludedDirs vendor,static,devDb,wiki,bin,tests
.PHONY: cloc
cloc:
# cloc can be installed using brew
cloc --exclude-dir=devDb,.idea,.vscode,wiki,static,vendor --exclude-ext=iml,xml .

View File

@ -44,19 +44,17 @@ You will need to install [Go 1.7](https://golang.org/dl/)
Then install dependencies:
```
$ go get github.com/beego/bee # bee command line tool
$ go get github.com/kardianos/govendor # dependency manager
$ govendor fetch
$ make setup
```
From here it's a normal [BeeGo](http://beego.me) development cycle. Some useful commands:
Some useful commands:
```bash
# Start local server (with hot reload)
$ bee run
$ make run
# Run all tests
$ go test `go list ./...|grep -v vendor` -v
$ make test
```