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

Kotlin Support #45

Open
bcmedeiros opened this issue Nov 18, 2018 · 3 comments
Open

Kotlin Support #45

bcmedeiros opened this issue Nov 18, 2018 · 3 comments

Comments

@bcmedeiros
Copy link

I'd like to be able to compile my templates directly to Kotlin, rather than use Java code mixed with Kotlin classes.

We may be able to use some support implemented in https://grpc.io/blog/kotlin-gradle-projects to achieve that.

@sergei-ivanov
Copy link
Member

I read that blog post and also checked out their release notes and the associated PRs. As far as I can tell, neither protoc nor grpc plugin generate Kotlin sources directly. Neither do they have protobuf/grpc runtime libraries written in Kotlin (again, AFAIK). I think the only thing they have done is a more seamless integration of protobuf-gradle-plugin with Kotlin build lifecycle in gradle.

To summarise, support for generation of Kotlin classes should be first implemented in Protobuf/gRPC. Feel free to vote for this feature request: protocolbuffers/protobuf#3742

@K1ngjulien
Copy link

@sergei-ivanov

protoc now natively supports generating a kotlin DSL on top of the java builders.
Unfortunately I've yet to figure out if its possible to use your plugin for this...

According to This guide it should be possible with a plugin, yet I get the following error:

The parameters 'pluginId' for goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile-custom are missing or invalid

It seems to me that because "kotlin" is now a built in plugin, the pluginId is rejected, or am I misunderstanding something completely?

It would be great to see some better documentation about this 😅

@liyunchou
Copy link

I meet the same problem when compile proto in java project, but also using the protobuf-maven-pligin. It turns out that my pom file is set to packaging in pom form, which should be jar from. I solved my problem after change the packaging type.
pom
jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants