Skip to content

Commit

Permalink
Remove build-grpc from Makefile (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Tideman authored Nov 6, 2023
1 parent 0766fdf commit 81d2e71
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,13 @@ PATH := $(GOBIN):$(PATH)

COLOR := "\e[1;36m%s\e[0m\n"

PROTO_ROOT := proto/api
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
PROTO_OUT := api
PROTO_IMPORTS := \
-I $(PROTO_ROOT) \
-I ./proto/dependencies/github.com/grpc-ecosystem/grpc-gateway/ \
-I ./proto/dependencies/github.com/gogo/googleapis/ \
-I ./proto/dependencies/api/ \
-I ./proto/dependencies/
PROTO_REFS := Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api
OPENAPI_OUT := openapi/assets

##### Build #####
build: build-grpc build-server
build: build-server

build-server:
go mod tidy
go build -o ui-server ./cmd/server/main.go

build-grpc:
@printf $(COLOR) "Compiling gRPC..."
rm -rf $(PROTO_OUT)
mkdir -p $(PROTO_OUT)
$(foreach PROTO_DIR,$(PROTO_DIRS),\
protoc $(PROTO_IMPORTS) \
--gogoslick_out=plugins=grpc,paths=source_relative,$(PROTO_REFS):$(PROTO_OUT) \
--grpc-gateway_out=allow_patch_feature=false,paths=source_relative:$(PROTO_OUT) \
--openapiv2_out=$(OPENAPI_OUT) \
$(PROTO_DIR)*.proto \
;)

##### Install dependencies #####

install-utils:
Expand Down

0 comments on commit 81d2e71

Please sign in to comment.