-
Notifications
You must be signed in to change notification settings - Fork 259
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 native kotlin support #337
Conversation
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
I have also updated the |
The new github action failed |
I will have to update the So this PR is dependend on: open-telemetry/build-tools#76 |
I have fixed the issue with the otel image locally. The builds are running and I hope this new functionality can be published soon so this PR can be finished and closed. I've tested with the local build and got the compiled kotlin files, snippet:
|
@vincentfree dependency merged, what else can I help with? |
@bogdandrutu I've tested it on my laptop so I'm quite sure that this PR is almost done. |
Makefile
Outdated
gen-kotlin: | ||
rm -rf ./$(PROTO_GEN_KOTLIN_DIR) | ||
mkdir -p ./$(PROTO_GEN_KOTLIN_DIR) | ||
$(foreach file,$(PROTO_FILES),$(call exec-command, $(PROTOC) --java_out=./$(PROTO_GEN_JAVA_DIR) --kotlin_out=./$(PROTO_GEN_KOTLIN_DIR) $(file))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this depend on gen-java instead of re-generating the java files in their dir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could but there is a relation between the java and kotlin generated classes. The kotlin file 's refer to those from Java so it might work but I've never seen kotlin generation without the java_out
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why the build failed is because it has a dependency on the newer otel image with my other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vincentfree I understand the build failure, but still not sure about the regenerating of the java files in this rule. I would give a try without to see what happens :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't hurt to try though the kotlin generation step would then have a dependency on the gen-java. Still it wouldn't have the overlap of files generated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest update you need to change gen-openapi
as well, no more swagger.
@bogdandrutu thanks for the new release of I've tested |
@arminru your review is required to pass this PR. It's fully ready to merge back to main |
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
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