Add native kotlin support (#337)

* Add native kotlin support

Kotlin support has been added to protobuf since version v3.17.0. 
The generated kotlin files have kotlin dal support as an added bonus over direct usage of the java versions of the protobuf .java files

* update forgotten value

* Verify gen-kotlin make step

* update the build image version

* alfabetical order, update image version

* gen-kotlin references gen-java, swagger changed to openapiv2

* update changelog file

* Update Makefile

* Update CHANGELOG.md

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
pull/350/head^2
Vincent Free 3 years ago committed by GitHub
parent f8c59fe6b0
commit 270488ea83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .github/workflows/build-check.yaml
  2. 5
      CHANGELOG.md
  3. 21
      Makefile

@ -75,3 +75,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: make gen-ruby
gen-kotlin:
needs: docker-pull
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make gen-kotlin

@ -10,11 +10,12 @@ Full list of differences found in [this compare](https://github.com/open-telemet
### Changed
* Remove if no changes for this section before release.
* `Swagger` generation updated to `openapiv2` due to the use of an updated version of protoc in `otel/build-protobuf`
* Update the `otel/build-protobuf` version from `0.4.0` to `0.9.0`
### Added
* Remove if no changes for this section before release.
* Protobuf kotlin source generation
### Removed

@ -15,9 +15,9 @@ endef
# Generate all implementations
.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-kotlin gen-objc gen-openapi gen-php gen-python gen-ruby
OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:0.4.0
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}
PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf
@ -26,6 +26,7 @@ PROTO_GEN_CSHARP_DIR ?= $(GENDIR)/csharp
PROTO_GEN_GO_DIR ?= $(GENDIR)/go
PROTO_GEN_JAVA_DIR ?= $(GENDIR)/java
PROTO_GEN_JS_DIR ?= $(GENDIR)/js
PROTO_GEN_KOTLIN_DIR ?= $(GENDIR)/kotlin
PROTO_GEN_OBJC_DIR ?= $(GENDIR)/objc
PROTO_GEN_OPENAPI_DIR ?= $(GENDIR)/openapi
PROTO_GEN_PHP_DIR ?= $(GENDIR)/php
@ -74,6 +75,14 @@ gen-java:
mkdir -p ./$(PROTO_GEN_JAVA_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --java_out=./$(PROTO_GEN_JAVA_DIR) $(file)))
# Generate gRPC/Protobuf implementation for Kotlin.
.PHONY: gen-kotlin
gen-kotlin: gen-java
rm -rf ./$(PROTO_GEN_KOTLIN_DIR)
mkdir -p ./$(PROTO_GEN_KOTLIN_DIR)
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --kotlin_out=./$(PROTO_GEN_KOTLIN_DIR) $(file)))
# Generate gRPC/Protobuf implementation for JavaScript.
.PHONY: gen-js
gen-js:
@ -94,13 +103,13 @@ gen-objc:
$(PROTOC) --objc_out=./$(PROTO_GEN_OBJC_DIR) --grpc-objc_out=./$(PROTO_GEN_OBJC_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --objc_out=./$(PROTO_GEN_OBJC_DIR) --grpc-objc_out=./$(PROTO_GEN_OBJC_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
# Generate gRPC/Protobuf for swagger
# Generate gRPC/Protobuf for openapi v2 (swagger)
.PHONY: gen-openapi
gen-openapi:
mkdir -p $(PROTO_GEN_OPENAPI_DIR)
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/metrics/v1/metrics_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --swagger_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/logs/v1/logs_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
$(PROTOC) --openapiv2_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --openapiv2_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/metrics/v1/metrics_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --openapiv2_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/logs/v1/logs_service_http.yaml:$(PROTO_GEN_OPENAPI_DIR) opentelemetry/proto/collector/logs/v1/logs_service.proto
# Generate gRPC/Protobuf implementation for PhP.
.PHONY: gen-php

Loading…
Cancel
Save