PluginFrontend

nscn.polaris2.protoc.bridge.frontend.PluginFrontend
See thePluginFrontend companion object

Platform-specific plumbing that lets protoc talk to a generator inside this JVM.

protoc only knows how to launch executables that read a CodeGeneratorRequest from stdin and write a CodeGeneratorResponse to stdout. A frontend therefore fabricates a tiny executable whose only job is to forward those two streams into this process:

  1. protoc writes the request to the plugin's stdin
  2. the plugin forwards it over a pipe or socket
  3. this JVM reads it, runs the generator
  4. this JVM writes the response back over the channel and closes it
  5. the plugin copies that to its stdout, where protoc picks it up

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Types

Value members

Abstract methods

def cleanup(state: InternalState): Unit
def prepare(plugin: ProtocCodeGenerator, env: ExtraEnv): (Path, InternalState)

Sets up the executable protoc should run, returning its path plus whatever state cleanup needs to tear it down.

Sets up the executable protoc should run, returning its path plus whatever state cleanup needs to tear it down.

Attributes