Class Protoc

java.lang.Object
org.xolstice.maven.plugin.protobuf.Protoc

final class Protoc extends Object
This class represents an invokable configuration of the protoc compiler. The actual executable is invoked using the plexus Commandline.
  • Method Details

    • execute

      public int execute(org.apache.maven.plugin.logging.Log log) throws org.codehaus.plexus.util.cli.CommandLineException, InterruptedException
      Invokes the protoc compiler using the configuration specified at construction.
      Parameters:
      log - logger instance.
      Returns:
      The exit status of protoc.
      Throws:
      org.codehaus.plexus.util.cli.CommandLineException - if command line environment cannot be set up.
      InterruptedException - if the execution was interrupted by the user.
    • buildProtocCommand

      public List<String> buildProtocCommand()
      Creates the command line arguments.

      This method has been made visible for testing only.

      Returns:
      A list consisting of the executable followed by any arguments.
    • logExecutionParameters

      public void logExecutionParameters(org.apache.maven.plugin.logging.Log log)
      Logs execution parameters on debug level to the specified logger. All log messages will be prefixed with ""[PROTOC] "".
      Parameters:
      log - a logger.
    • getOutput

      public String getOutput()
      Returns:
      the output
    • getError

      public String getError()
      Returns:
      the error