Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add protoc-gen-swift to Makefile to update proto files for opentelemetry-swift #396

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endef

# Generate all implementations
.PHONY: gen-all
gen-all: gen-cpp gen-csharp gen-go gen-java gen-kotlin gen-objc gen-openapi gen-php gen-python gen-ruby
gen-all: gen-cpp gen-csharp gen-go gen-java gen-kotlin gen-objc gen-openapi gen-php gen-python gen-ruby gen-swift

OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:0.9.0
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path=${PWD}
Expand All @@ -31,6 +31,7 @@ PROTO_GEN_OPENAPI_DIR ?= $(GENDIR)/openapi
PROTO_GEN_PHP_DIR ?= $(GENDIR)/php
PROTO_GEN_PYTHON_DIR ?= $(GENDIR)/python
PROTO_GEN_RUBY_DIR ?= $(GENDIR)/ruby
PROTO_GEN_SWIFT_DIR ?= $(GENDIR)/swift

# Docker pull image.
.PHONY: docker-pull
Expand Down Expand Up @@ -139,3 +140,13 @@ gen-ruby:
$(PROTOC) --ruby_out=./$(PROTO_GEN_RUBY_DIR) --grpc-ruby_out=./$(PROTO_GEN_RUBY_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --ruby_out=./$(PROTO_GEN_RUBY_DIR) --grpc-ruby_out=./$(PROTO_GEN_RUBY_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --ruby_out=./$(PROTO_GEN_RUBY_DIR) --grpc-ruby_out=./$(PROTO_GEN_RUBY_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto

# Generate gRPC/Protobuf implementation for Swift.
.PHONY: gen-swift
gen-swift:
rm -rf ./$(PROTO_GEN_SWIFT_DIR)
mkdir -p ./$(PROTO_GEN_SWIFT_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --swift_out=./$(PROTO_GEN_SWIFT_DIR) $(file)))
$(PROTOC) --swift_out=./$(PROTO_GEN_SWIFT_DIR) --grpc-swift_out=./$(PROTO_GEN_SWIFT_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --swift_out=./$(PROTO_GEN_SWIFT_DIR) --grpc-swift_out=./$(PROTO_GEN_SWIFT_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --swift_out=./$(PROTO_GEN_SWIFT_DIR) --grpc-swift_out=./$(PROTO_GEN_SWIFT_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ To generate the raw gRPC client libraries, use `make gen-${LANGUAGE}`. Currently
* php
* python
* ruby
* swift

## Maturity Level

Expand Down