PiperOrigin-RevId: 663760495pull/17832/head
parent
546c8e0a25
commit
48f2faa70e
8 changed files with 53 additions and 27 deletions
@ -0,0 +1,19 @@ |
|||||||
|
cc_library( |
||||||
|
name = "kotlin", |
||||||
|
srcs = ["generator.cc"], |
||||||
|
hdrs = ["generator.h"], |
||||||
|
strip_include_prefix = "/src", |
||||||
|
visibility = [ |
||||||
|
"//pkg:__pkg__", |
||||||
|
"//src/google/protobuf/compiler:__pkg__", |
||||||
|
], |
||||||
|
deps = [ |
||||||
|
"//src/google/protobuf", |
||||||
|
"//src/google/protobuf:port", |
||||||
|
"//src/google/protobuf/compiler:code_generator", |
||||||
|
"//src/google/protobuf/compiler/java", |
||||||
|
"//src/google/protobuf/compiler/java:helpers", |
||||||
|
"//src/google/protobuf/io:printer", |
||||||
|
"@com_google_absl//absl/strings", |
||||||
|
], |
||||||
|
) |
@ -0,0 +1,16 @@ |
|||||||
|
|
||||||
|
# Kotlin DSL Generator |
||||||
|
|
||||||
|
This code generator implements the Kotlin DSL. The Kotlin DSL sits on top of |
||||||
|
another proto implementation (written in Java or Kotlin) and adds convenient |
||||||
|
support for building proto messages using DSL syntax, as documented in |
||||||
|
[Kotlin Generated Code Guide](https://protobuf.dev/reference/kotlin/kotlin-generated/). |
||||||
|
|
||||||
|
This code generator is invoked by passing `--kotlin_out` to `protoc`. |
||||||
|
|
||||||
|
When using Kotlin on the JVM, you will also need to pass `--java_out` to |
||||||
|
generate the Java code that implements the generated classes themselves. |
||||||
|
|
||||||
|
When using Kotlin on other platforms (eg. Kotlin Native), there is currently no |
||||||
|
support for generating message classes, so it is not possible to use the Kotlin |
||||||
|
DSL at this time. |
Loading…
Reference in new issue