Class PbjCompiler

java.lang.Object
com.hedera.pbj.compiler.PbjCompiler

public abstract class PbjCompiler extends Object
Compiler entry point to generate java src code from protobuf proto schema files.
  • Constructor Details

    • PbjCompiler

      public PbjCompiler()
  • Method Details

    • compileFilesIn

      public static void compileFilesIn(Iterable<File> sourceFiles, Iterable<File> classpath, Set<File> sourceRoots, File mainOutputDir, File testOutputDir, String javaPackageSuffix, boolean generateTestClasses) throws Exception
      Compile source files and generate PBJ models.
      Parameters:
      sourceFiles - all the source files to compile
      classpath - protobuf files in dependencies located on the Java compile classpath
      sourceRoots - folders containing the source files
      mainOutputDir - output directory for generated model, codecs, and schema ("main" files)
      testOutputDir - output directory for generated tests ("test" files)
      javaPackageSuffix - an optional, nullable suffix to add to the Java package name in generated classes, e.g. ".pbj", when an explicit `pbj.java_package` option is missing
      Throws:
      Exception