forked from mwitkow/go-proto-validators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (38 loc) · 1.27 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
# Copyright 2016 Michal Witkowski. All Rights Reserved.
# See LICENSE for licensing terms.
export PATH := ${GOPATH}/bin:${PATH}
install:
@echo "--- Installing govalidators to GOPATH"
go install github.com/mwitkow/go-proto-validators/protoc-gen-govalidators
regenerate_test_gogo:
@echo "Regenerating test .proto files with gogo imports"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=test \
--gogo_out=test/gogo \
--govalidators_out=gogoimport=true:test/gogo test/*.proto)
regenerate_test_golang:
@echo "--- Regenerating test .proto files with golang imports"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=test \
--go_out=test/golang \
--govalidators_out=test/golang test/*.proto)
regenerate_example: install
@echo "--- Regenerating example directory"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=. \
--go_out=. \
--govalidators_out=. examples/*.proto)
test: install regenerate_test_gogo regenerate_test_golang
@echo "Running tests"
go test -v ./...
regenerate:
@echo "--- Regenerating validator.proto"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
--proto_path=. \
--gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. \
validator.proto)