Skip to content

Conversation

Zetten
Copy link

@Zetten Zetten commented Feb 17, 2023

Provide rules to build Kotlin proto and grpc libraries. Currently upstream Protobuf and gRPC support only JVM-flavour Kotlin.

Fixes #139.

A few notes on implementation:

  • Mostly simple, largely copied from the Java implementation.
  • An updated routeguide example was adapted from https://github.com/grpc/grpc-kotlin - with renamed packages to avoid class collision with the Java example.

Some points which may want attention before merging:

  • WORKSPACE ordering had to be rearranged a bit - grpc_extra_deps imports its own (older) rules_kotlin which got messy.
  • Not sure how best to document the optional java_<type>_target parameter on the macro - the Kotlin rules depend on the compiled Java library for the same proto, but users may want to build them separately for some reason.
  • Naming would ideally be kt_jvm_* under the kotlin directory, but this doesn't seem simple to do without heavily modifying the rulegen templates. Probably not a huge problem.

@github-actions github-actions bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation lang-java Java rules specific labels Feb 17, 2023
@aaliddell aaliddell mentioned this pull request Mar 5, 2023
Provide rules to build Kotlin proto and grpc libraries. Currently
upstream Protobuf and gRPC support only JVM-flavour Kotlin.

Fixes rules-proto-grpc#139.
@Zetten Zetten force-pushed the add-kotlin-rules branch from cd72ec4 to c2a110f Compare May 5, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation lang-java Java rules specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin-JVM support (protobuf >=3.17.0)

1 participant