Skip to content

Commit

Permalink
Update dependency declarations in the Makefile
Browse files Browse the repository at this point in the history
This reduces unnecessary rebuilds by swagger-codegen
  • Loading branch information
yugui committed Apr 24, 2018
1 parent ec9a110 commit 2357d5b
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,32 @@ EXAMPLES=examples/examplepb/echo_service.proto \
examples/examplepb/wrappers.proto
EXAMPLE_SVCSRCS=$(EXAMPLES:.proto=.pb.go)
EXAMPLE_GWSRCS=$(EXAMPLES:.proto=.pb.gw.go)
EXAMPLE_SWAGGERSRCS=$(EXAMPLES:.proto=.swagger.json)
EXAMPLE_SWAGGERSRCS=$(SWAGGER_EXAMPLES:.proto=.swagger.json)
EXAMPLE_DEPS=examples/sub/message.proto examples/sub2/message.proto
EXAMPLE_DEPSRCS=$(EXAMPLE_DEPS:.proto=.pb.go)

EXAMPLE_CLIENT_DIR=examples/clients
ECHO_EXAMPLE_SPEC=examples/examplepb/echo_service.swagger.json
ECHO_EXAMPLE_SRCS=$(EXAMPLE_CLIENT_DIR)/echo/EchoServiceApi.go \
$(EXAMPLE_CLIENT_DIR)/echo/ExamplepbSimpleMessage.go
ECHO_EXAMPLE_SRCS=$(EXAMPLE_CLIENT_DIR)/echo/api_client.go \
$(EXAMPLE_CLIENT_DIR)/echo/api_response.go \
$(EXAMPLE_CLIENT_DIR)/echo/configuration.go \
$(EXAMPLE_CLIENT_DIR)/echo/echo_service_api.go \
$(EXAMPLE_CLIENT_DIR)/echo/examplepb_simple_message.go
ABE_EXAMPLE_SPEC=examples/examplepb/a_bit_of_everything.swagger.json
ABE_EXAMPLE_SRCS=$(EXAMPLE_CLIENT_DIR)/abe/ABitOfEverythingServiceApi.go \
$(EXAMPLE_CLIENT_DIR)/abe/ABitOfEverythingNested.go \
$(EXAMPLE_CLIENT_DIR)/abe/ExamplepbABitOfEverything.go \
$(EXAMPLE_CLIENT_DIR)/abe/ExamplepbNumericEnum.go \
$(EXAMPLE_CLIENT_DIR)/abe/ExamplepbIdMessage.go \
$(EXAMPLE_CLIENT_DIR)/abe/NestedDeepEnum.go \
$(EXAMPLE_CLIENT_DIR)/abe/ProtobufEmpty.go \
$(EXAMPLE_CLIENT_DIR)/abe/Sub2IdMessage.go \
$(EXAMPLE_CLIENT_DIR)/abe/SubStringMessage.go
ABE_EXAMPLE_SRCS=$(EXAMPLE_CLIENT_DIR)/abe/a_bit_of_everything_nested.go \
$(EXAMPLE_CLIENT_DIR)/abe/a_bit_of_everything_service_api.go \
$(EXAMPLE_CLIENT_DIR)/abe/api_client.go \
$(EXAMPLE_CLIENT_DIR)/abe/api_response.go \
$(EXAMPLE_CLIENT_DIR)/abe/camel_case_service_name_api.go \
$(EXAMPLE_CLIENT_DIR)/abe/configuration.go \
$(EXAMPLE_CLIENT_DIR)/abe/echo_rpc_api.go \
$(EXAMPLE_CLIENT_DIR)/abe/echo_service_api.go \
$(EXAMPLE_CLIENT_DIR)/abe/examplepb_a_bit_of_everything.go \
$(EXAMPLE_CLIENT_DIR)/abe/examplepb_body.go \
$(EXAMPLE_CLIENT_DIR)/abe/examplepb_numeric_enum.go \
$(EXAMPLE_CLIENT_DIR)/abe/nested_deep_enum.go \
$(EXAMPLE_CLIENT_DIR)/abe/protobuf_empty.go \
$(EXAMPLE_CLIENT_DIR)/abe/sub_string_message.go
EXAMPLE_CLIENT_SRCS=$(ECHO_EXAMPLE_SRCS) $(ABE_EXAMPLE_SRCS)
SWAGGER_CODEGEN=swagger-codegen

Expand Down Expand Up @@ -144,14 +152,14 @@ lint:
go vet $(PKG)/protoc-gen-grpc-gateway/...
go vet $(PKG)/protoc-gen-swagger/...

clean distclean:
rm -f $(GATEWAY_PLUGIN)
clean:
rm -f $(GATEWAY_PLUGIN) $(SWAGGER_PLUGIN)
distclean: clean
rm -f $(GO_PLUGIN)
realclean: distclean
rm -f $(EXAMPLE_SVCSRCS) $(EXAMPLE_DEPSRCS)
rm -f $(EXAMPLE_GWSRCS)
rm -f $(EXAMPLE_SWAGGERSRCS)
rm -f $(GO_PLUGIN)
rm -f $(SWAGGER_PLUGIN)
rm -f $(EXAMPLE_CLIENT_SRCS)
rm -f $(OPENAPIV2_GO)

Expand Down

0 comments on commit 2357d5b

Please sign in to comment.