Skip to content

Commit

Permalink
feat: add swagger output + bump generators
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jan 15, 2019
1 parent 91cb880 commit c823d4a
Show file tree
Hide file tree
Showing 7 changed files with 1,301 additions and 361 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subs
GOPATH ?= $(HOME)/go
BIN = $(GOPATH)/bin/calcbiz
SOURCES = $(call rwildcard, ./, *.go)
OUR_SOURCES = $(filter-out $(call rwildcard,vendor//,*.go),$(SOURCES))
OUR_SOURCES = $(filter-out $(call rwildcard,./vendor,*.go),$(SOURCES))
PROTOS = $(call rwildcard, ./, *.proto)
OUR_PROTOS = $(filter-out $(call rwildcard,vendor//,*.proto),$(PROTOS))
OUR_PROTOS = $(filter-out $(call rwildcard,./vendor,*.proto),$(PROTOS))
GENERATED_FILES = \
$(patsubst %.proto,%.pb.go,$(PROTOS)) \
$(call rwildcard .//, *.gen.go) \
$(call rwildcard .//, *.pb.gw.go)
$(call rwildcard .//, *.pb.gw.go) \
apidocs.swagger.json

PROTOC_OPTS = -I/protobuf:vendor:.
RUN_OPTS ?=

Expand Down Expand Up @@ -88,6 +90,12 @@ test: .generated
--gogofaster_out=plugins=grpc:"$(GOPATH)/src" \
"$(dir $<)"/*.proto

apidocs.swagger.json: $(OUR_PROTOS)
protoc \
$(PROTOC_OPTS) \
--swagger_out=allow_merge=true:. \
./api/api.proto

.PHONY: lint
lint:
golangci-lint run --verbose ./...
Expand Down
Loading

0 comments on commit c823d4a

Please sign in to comment.