Skip to content

Commit

Permalink
Merge pull request #1875 from owncloud/fix_proto
Browse files Browse the repository at this point in the history
unique proto package names
  • Loading branch information
wkloucek authored Mar 31, 2021
2 parents 0dadf6f + 9bc0cb4 commit 3f37ddb
Show file tree
Hide file tree
Showing 24 changed files with 1,788 additions and 1,604 deletions.
24 changes: 12 additions & 12 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ $(BINGO): $(BINGO_DIR)/bingo.mod
@echo "(re)installing $(GOBIN)/bingo-v0.4.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.4.0 "github.com/bwplotka/bingo"

BUF := $(GOBIN)/buf-v0.37.1
BUF := $(GOBIN)/buf-v0.40.0
$(BUF): $(BINGO_DIR)/buf.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/buf-v0.37.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.37.1 "github.com/bufbuild/buf/cmd/buf"
@echo "(re)installing $(GOBIN)/buf-v0.40.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.40.0 "github.com/bufbuild/buf/cmd/buf"

CALENS := $(GOBIN)/calens-v0.2.0
$(CALENS): $(BINGO_DIR)/calens.mod
Expand Down Expand Up @@ -83,29 +83,29 @@ $(PROTOC_GEN_DOC): $(BINGO_DIR)/protoc-gen-doc.mod
@echo "(re)installing $(GOBIN)/protoc-gen-doc-v1.4.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-doc.mod -o=$(GOBIN)/protoc-gen-doc-v1.4.1 "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"

PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.25.0
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.26.0
$(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.25.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.25.0 "google.golang.org/protobuf/cmd/protoc-gen-go"
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.26.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.26.0 "google.golang.org/protobuf/cmd/protoc-gen-go"

PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9
PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888
$(PROTOC_GEN_MICRO): $(BINGO_DIR)/protoc-gen-micro.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"

PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4
$(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-microweb.mod -o=$(GOBIN)/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4 "github.com/owncloud/protoc-gen-microweb"

PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.2.0
PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.3.0
$(PROTOC_GEN_OPENAPIV2): $(BINGO_DIR)/protoc-gen-openapiv2.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-openapiv2-v2.2.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-openapiv2.mod -o=$(GOBIN)/protoc-gen-openapiv2-v2.2.0 "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
@echo "(re)installing $(GOBIN)/protoc-gen-openapiv2-v2.3.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-openapiv2.mod -o=$(GOBIN)/protoc-gen-openapiv2-v2.3.0 "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"

REFLEX := $(GOBIN)/reflex-v0.3.0
$(REFLEX): $(BINGO_DIR)/reflex.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/buf.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require github.com/bufbuild/buf v0.37.1 // cmd/buf
require github.com/bufbuild/buf v0.40.0 // cmd/buf
2 changes: 1 addition & 1 deletion .bingo/protoc-gen-go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require google.golang.org/protobuf v1.25.0 // cmd/protoc-gen-go
require google.golang.org/protobuf v1.26.0 // cmd/protoc-gen-go
2 changes: 1 addition & 1 deletion .bingo/protoc-gen-micro.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20210217182006-0f0ace1a44a9
require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20210329103359-9b41d1bf0888
2 changes: 1 addition & 1 deletion .bingo/protoc-gen-openapiv2.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require github.com/grpc-ecosystem/grpc-gateway/v2 v2.2.0 // protoc-gen-openapiv2
require github.com/grpc-ecosystem/grpc-gateway/v2 v2.3.0 // protoc-gen-openapiv2
8 changes: 4 additions & 4 deletions .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi

BINGO="${GOBIN}/bingo-v0.4.0"

BUF="${GOBIN}/buf-v0.37.1"
BUF="${GOBIN}/buf-v0.40.0"

CALENS="${GOBIN}/calens-v0.2.0"

Expand All @@ -30,13 +30,13 @@ MUTAGEN="${GOBIN}/mutagen-v0.11.8"

PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.4.1"

PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.25.0"
PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.26.0"

PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20210217182006-0f0ace1a44a9"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888"

PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20210224131655-d9b1137a84d4"

PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.2.0"
PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.3.0"

REFLEX="${GOBIN}/reflex-v0.3.0"

8 changes: 4 additions & 4 deletions .make/protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ $(PROTO_SRC)/${NAME}.pb.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_GO)
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-go=$(PROTOC_GEN_GO) \
--go_out=. \
--go_out=$(PROTO_SRC) --go_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.pb.micro.go
$(PROTO_SRC)/${NAME}.pb.micro.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICRO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.micro.go"
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.micro.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-micro=$(PROTOC_GEN_MICRO) \
--micro_out=. \
--micro_out=$(PROTO_SRC) --micro_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.pb.web.go
Expand All @@ -33,7 +33,7 @@ $(PROTO_SRC)/${NAME}.pb.web.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICROWE
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-microweb=$(PROTOC_GEN_MICROWEB) \
--microweb_out=. \
--microweb_out=$(PROTO_SRC) --microweb_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.swagger.json
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ go-coverage:
echo -n "% coverage $$mod: "; $(MAKE) --no-print-directory -C $$mod go-coverage; \
done

.PHONY: protobuf
protobuf:
@for mod in $(OCIS_MODULES); do \
echo -n "% protobuf $$mod: "; $(MAKE) --no-print-directory -C $$mod protobuf; \
done

.PHONY: bingo-update
bingo-update: $(BINGO)
$(BINGO) get -u
Expand Down
4 changes: 2 additions & 2 deletions accounts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ node_modules:
yarn install --frozen-lockfile

############ protobuf ############
include ../.make/protobuf.mk

PROTO_VERSION := v0
PROTO_SRC := pkg/proto/$(PROTO_VERSION)

include ../.make/protobuf.mk

.PHONY: protobuf
protobuf: $(PROTO_SRC)/${NAME}.pb.go \
$(PROTO_SRC)/${NAME}.pb.micro.go \
Expand Down
Loading

0 comments on commit 3f37ddb

Please sign in to comment.