forked from mwitkow/go-proto-validators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 1.08 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
# 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:
@echo "Regenerating test .proto files"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
--proto_path=. \
--gogo_out=. \
--govalidators_out=. test/*.proto)
regenerate_example: install
@echo "Regenerating example directory"
(protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
--proto_path=. \
--go_out=. \
--govalidators_out=. examples/*.proto)
test: install regenerate_test
@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)