forked from asynkron/protoactor-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (28 loc) · 889 Bytes
/
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
.PHONY: all test
all: build
build: protogen
go build ./...
# {{{ Protobuf
# Protobuf definitions
PROTO_FILES := $(shell find . \( -path "./languages" -o -path "./specification" \) -prune -o -type f -name '*.proto' -print)
# Protobuf Go files
PROTO_GEN_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES))
# Protobuf generator
PROTO_MAKER := protoc --gogoslick_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,plugins=grpc:.
protogen: $(PROTO_GEN_FILES)
%.pb.go: %.proto
cd $(dir $<); $(PROTO_MAKER) --proto_path=. --proto_path=$(GOPATH)/src ./*.proto
sed -i '' -En -e '/^package [[:alpha:]]+/,$$p' $@
# }}} Protobuf end
# {{{ Cleanup
clean: protoclean
protoclean:
rm -rf $(PROTO_GEN_FILES)
# }}} Cleanup end
# {{{ test
PACKAGES := $(shell go list ./... | grep -v "/examples/")
test:
go test $(PACKAGES)
test-short:
go test -short $(PACKAGES)
# }}} test