Emits http4s service bindings for every service in a .proto.
Ported from org.http4s.grpc.generator.Http4sGrpcCodeGenerator, and rebased from ScalaPB onto mill-protoc: the message types it refers to are the ones nscn.polaris2.protoc.codegen.Scala3Generator emits, and the naming decisions come from the same GenContext that generator uses. Sharing that context is what keeps flat_package, (nscn.polaris2.protoc.file).package_name and the rest agreeing across the two targets; a service referring to a type name the message generator did not produce is the failure mode this avoids.
mill-protoc's own generator ignores service declarations entirely, so the two targets never write the same file.
This is a plain ProtocCodeGenerator, so it runs in-process through the bridge (how nscn.polaris2.mill.Http4sGrpcModule drives it) or as a standalone protoc plugin through its inherited main.
Teaches the request parser about mill-protoc's options.
Teaches the request parser about mill-protoc's options.
Without it every (nscn.polaris2.protoc.*) option arrives as an unknown field and reads back as its default, so this generator would compute different names than the message generator for exactly the files that configure anything.
final def run(input: CodedInputStream): Array[Byte]
Never throws: a generator that dies without writing a response leaves protoc waiting on the pipe, so every failure is converted into a CodeGeneratorResponse.error.
Never throws: a generator that dies without writing a response leaves protoc waiting on the pipe, so every failure is converted into a CodeGeneratorResponse.error.
Attributes
Inherited from:
CodeGenApp
final override def run(req: Array[Byte]): Array[Byte]