PluginFrontend

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

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def createCodeGeneratorResponseWithError(error: String): Array[Byte]

Hand-encodes a CodeGeneratorResponse carrying only error (field 1).

Hand-encodes a CodeGeneratorResponse carrying only error (field 1).

Hand-encoded because this is the last-resort path: it must still work when the failure that got us here was an OutOfMemoryError.

Attributes

def createTempFile(extension: String, content: String): Path
def isMac: Boolean
def isWindows: Boolean
def runWithBytes(gen: ProtocCodeGenerator, request: Array[Byte]): Array[Byte]
def runWithInputStream(gen: ProtocCodeGenerator, fsin: InputStream, env: ExtraEnv): Array[Byte]

Reads a request, appends the extra environment, runs the generator.

Reads a request, appends the extra environment, runs the generator.

Catches Throwable, not Exception: if the generator dies of an OutOfMemoryError or StackOverflowError and we return nothing, protoc waits on the pipe forever. A response carrying the stack trace is always better than a hang.

Attributes