From 529acf65ffdf60f2672c51362f7d858090b5a475 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 28 Sep 2016 18:07:08 +0100 Subject: [PATCH] Improve make tasks --- Makefile | 38 ++++++++++++++++++++------------------ circle.yml | 5 ++++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index beb4e973..80dcacd6 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,15 @@ kill: .PHONY: convey convey: @echo "Run 'go get -u -v github.com/smartystreets/goconvey'" - goconvey -packages 5 -port 5000 -poll 1s -excludedDirs 'build,dev,doc,gui,vendor' + goconvey -packages 50 -port 5000 -poll 10m -excludedDirs 'build,dev,doc,gui,vendor' + +# The `make test` command runs all +# tests, found within all sub-folders +# in the project folder. + +.PHONY: tests +tests: + $(GO) test `glide novendor` # The `make glide` command ensures that # all imported dependencies are synced @@ -49,16 +57,6 @@ convey: glide: glide install -# The `make test` command runs all -# tests, found within all sub-folders -# in the project folder. - -.PHONY: test -test: clean -test: glide -test: - $(GO) test `glide novendor` - # The `make clean` command cleans # all object, build, and test files # and removes the executable file. @@ -68,13 +66,21 @@ clean: rm -rf vendor $(GO) clean -i `glide novendor` find . -name '*.test' -type f -exec rm -f {} \; + find . -name '*.gen.go' -type f -exec rm -f {} \; + +# The `make setup` command runs the +# go generate command in all of the +# project subdirectories. + +.PHONY: setup +setup: + CGO_ENABLED=0 $(GO) generate -v `glide novendor` # The `make quick` command compiles # the build flags, gets the project # dependencies, and runs a build. .PHONY: quick -quick: LDF += $(shell GOPATH=${GOPATH} build/flags.sh) quick: CGO_ENABLED=0 $(GO) build @@ -84,10 +90,8 @@ quick: .PHONY: build build: LDF += $(shell GOPATH=${GOPATH} build/flags.sh) -build: clean -build: glide build: - CGO_ENABLED=0 $(GO) build -a -v -ldflags '$(LDF)' + CGO_ENABLED=0 $(GO) build -v -ldflags '$(LDF)' # The `make install` command compiles # the build flags, gets the project @@ -95,10 +99,8 @@ build: .PHONY: install install: LDF += $(shell GOPATH=${GOPATH} build/flags.sh) -install: clean -install: glide install: - CGO_ENABLED=0 $(GO) install -a -v -ldflags '$(LDF)' + CGO_ENABLED=0 $(GO) install -v -ldflags '$(LDF)' # The `make ember` command compiles # the ember project, and outputs diff --git a/circle.yml b/circle.yml index 050b3658..f9934330 100644 --- a/circle.yml +++ b/circle.yml @@ -33,7 +33,10 @@ dependencies: test: override: - - make test + - make clean + - make glide + - make setup + - make tests - make build - make ember - docker build -t abcum/surreal .