-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
48 lines (36 loc) · 1.42 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
.PHONY: lint setup test
PWD=$(shell pwd)
setup:
$(info Synching dev tools and dependencies...)
@if test -z $(which retool); then go get github.com/twitchtv/retool; fi
@retool sync
@retool do dep ensure
lint:
@docker run --rm \
-v $(PWD):$(PWD) \
-w $(PWD)/proto \
gwihlidal/protoc sfapi.proto -I. --lint_out=.
.PHONY: generate-pb;
generate-pb:
$(info Generating go and gRPC protos...)
@docker run -v $(PWD):/defs namely/protoc-all:1.9 -d proto -l go -o server/proto
server/api/mocks/provider.go: server/db/provider.go
$(info Generating mock provider...)
@retool do mockery -name Provider -dir server/db -output ./server/api/mocks
server/api/mocks/starship_action.go:
$(info Generating mock stream provider...)
@retool do mockery -name Starfriends_ListStarshipActionsServer -dir server/proto -output ./server/api/mocks
server/proto/%.pb.go: proto/%.proto
$(info DEPRECATED: use "make generate-pb" instead)
examples/ruby/proto/%.rb:
$(info Generating ruby protos...)
@docker run -v $(PWD):/defs namely/protoc-all:1.9 -d proto -l ruby -o examples/ruby/proto
rpc-server: server/main.go server/api/*.go server/proto/sfapi.pb.go
$(info Building RPC server...)
@go build -o rpc-server ./server
run-server: rpc-server
./rpc-server grpc-server
run-gateway: rpc-server
./rpc-server gw-server
test: server/proto/sfapi.pb.go server/proto/json_db.pb.go server/api/mocks/provider.go
@go test -v -cover ./server/api ./server/db