-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /usr/bin/make
ifeq ($(OS),Windows_NT)
BUILD_TARGET_FILES = goaviron.exe main.go
else
BUILD_TARGET_FILES ?= goaviron main.go
endif
DESIGN_PACKAGE = goaviron/design
.DEFAULT_GOAL := prepare
all: cleandep depend clean mkdir precompile gen precompile build
prepare: cleandep depend clean mkdir precompile gen precompile
depend:
@dep ensure
cleandep:
@rm -rf vendor
clean:
@rm -rf app
@ls swagger | grep -v -E "swaggerui$$" | xargs -I{} rm -rf swagger/{}
@rm -rf assets
mkdir:
@mkdir swagger/specs
confinit:
@cp config/local.toml.example config/local.toml
@cp config/test.toml.example config/test.toml
gen:
@goagen app -d $(DESIGN_PACKAGE)
@goagen swagger -d $(DESIGN_PACKAGE) -o swagger
@rm -rf swagger/specs
@mv swagger/swagger swagger/specs
@goagen controller -d $(DESIGN_PACKAGE) --pkg controller -o presentation/controller
precompile:
@go-bindata -pkg=swaggerassets -o=swagger/swaggerassets/swagger.go swagger/specs/... swagger/swaggerui/...
@go-bindata -pkg=assets -o=assets/bindata.go config/...
build:
@go build -o $(BUILD_TARGET_FILES)
go-run:
@go run main.go
run: precompile go-run
test:
@go test -tags=test goaviron/presentation/... -cover