Add plugin support to write custom well-known types.
I think this feature would make pbandk much more convenient for some use-cases. For example we would like to use java.time.Instant instead of wkt.Timestamp.
We have some custom types such as UUID we would like to convert it to java.util.UUID.
I am trying to understand how this works:
|
val needToGenerate = request.fileToGenerate.contains(protoFile.name) |
|
|
|
// Convert the file to our model |
|
val file = FileBuilder.buildFile(FileBuilder.Context(protoFile, params.let { |
|
// As a special case, if we're not generating it but it's a well-known type package, change it our known one |
|
if (needToGenerate || packageName != "google.protobuf") it |
|
else it + ("kotlin_package" to "pbandk.wkt") |
|
})) |
|
|
How can we modify this bit to inject custom WKTs?
Add plugin support to write custom well-known types.
I think this feature would make pbandk much more convenient for some use-cases. For example we would like to use
java.time.Instantinstead ofwkt.Timestamp.We have some custom types such as
UUIDwe would like to convert it tojava.util.UUID.I am trying to understand how this works:
pbandk/protoc-gen-pbandk/lib/src/commonMain/kotlin/pbandk/gen/Main.kt
Lines 36 to 44 in 120f51b
How can we modify this bit to inject custom WKTs?