Upgrade proto docker, add support for JS and grpc-web (#306)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
pull/307/head
Bogdan Drutu 4 years ago committed by GitHub
parent 8672494217
commit b03df024c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      Makefile

@ -17,7 +17,7 @@ endef
.PHONY: gen-all .PHONY: gen-all
gen-all: gen-cpp gen-csharp gen-go gen-java gen-objc gen-openapi gen-php gen-python gen-ruby gen-all: gen-cpp gen-csharp gen-go gen-java gen-objc gen-openapi gen-php gen-python gen-ruby
OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:0.2.1 OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:0.4.0
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD} PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD}
PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf
@ -25,6 +25,7 @@ PROTO_GEN_CPP_DIR ?= $(GENDIR)/cpp
PROTO_GEN_CSHARP_DIR ?= $(GENDIR)/csharp PROTO_GEN_CSHARP_DIR ?= $(GENDIR)/csharp
PROTO_GEN_GO_DIR ?= $(GENDIR)/go PROTO_GEN_GO_DIR ?= $(GENDIR)/go
PROTO_GEN_JAVA_DIR ?= $(GENDIR)/java PROTO_GEN_JAVA_DIR ?= $(GENDIR)/java
PROTO_GEN_JS_DIR ?= $(GENDIR)/js
PROTO_GEN_OBJC_DIR ?= $(GENDIR)/objc PROTO_GEN_OBJC_DIR ?= $(GENDIR)/objc
PROTO_GEN_OPENAPI_DIR ?= $(GENDIR)/openapi PROTO_GEN_OPENAPI_DIR ?= $(GENDIR)/openapi
PROTO_GEN_PHP_DIR ?= $(GENDIR)/php PROTO_GEN_PHP_DIR ?= $(GENDIR)/php
@ -73,6 +74,16 @@ gen-java:
mkdir -p ./$(PROTO_GEN_JAVA_DIR) mkdir -p ./$(PROTO_GEN_JAVA_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --java_out=./$(PROTO_GEN_JAVA_DIR) $(file))) $(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --java_out=./$(PROTO_GEN_JAVA_DIR) $(file)))
# Generate gRPC/Protobuf implementation for JavaScript.
.PHONY: gen-js
gen-js:
rm -rf ./$(PROTO_GEN_JS_DIR)
mkdir -p ./$(PROTO_GEN_JS_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --js_out=import_style=commonjs:./$(PROTO_GEN_JS_DIR) $(file)))
$(PROTOC) --js_out=import_style=commonjs:./$(PROTO_GEN_JS_DIR) --grpc-web_out=import_style=commonjs,mode=grpcweb:./$(PROTO_GEN_JS_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --js_out=import_style=commonjs:./$(PROTO_GEN_JS_DIR) --grpc-web_out=import_style=commonjs,mode=grpcweb:./$(PROTO_GEN_JS_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --js_out=import_style=commonjs:./$(PROTO_GEN_JS_DIR) --grpc-web_out=import_style=commonjs,mode=grpcweb:./$(PROTO_GEN_JS_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
# Generate gRPC/Protobuf implementation for Objective-C. # Generate gRPC/Protobuf implementation for Objective-C.
.PHONY: gen-objc .PHONY: gen-objc
gen-objc: gen-objc:

Loading…
Cancel
Save