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

Provide a protoc-gen-kotlin maven artifact that's compatible with the protobuf gradle plugin #18

Open
garyp opened this issue Aug 17, 2019 · 0 comments

Comments

@garyp
Copy link

garyp commented Aug 17, 2019

The protobuf gradle plugin supports downloading protoc plugins from maven central: https://github.com/google/protobuf-gradle-plugin#locate-external-executables. This would make it much easier to use pb-and-k in a gradle build since the protoc-gen-kotlin binary wouldn't have to be compiled/installed manually.

The requirements to enable this are:

  • Package protoc-gen-kotlin as a self-executable jar. For example, you can use something like the Spring Boot Gradle Plugin to create a fully executable archive.

  • Distribute the self-executable jar on maven central with a custom classifier (the protobuf gradle plugin doesn't provide any way to use an artifact with an empty classifier).

For example, if the self-executable jar is distributed as the com.github.cretz.pbandk:protoc-gen-kotlin artifact with a jvm8 classifier, then it could be used with the protobuf gradle plugin like this:

 protobuf {
    plugins {
        kotlin {
            artifact = 'com.github.cretz.pbandk:protoc-gen-kotlin:0.3.0:jvm8@jar'
        }
    }
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant