Class PyronautCompiler

java.lang.Object
io.micronaut.python.compiler.PyronautCompiler

public final class PyronautCompiler extends Object
Compiler for Python applications using Micronaut annotation processing. This compiler can operate in two modes:
  • In-memory mode: buildClassLoader() - compiles to memory and returns a ClassLoader
  • File system mode: compile() - compiles to disk when targetDir is specified
Since:
5.2.0
Author:
Micronaut
  • Method Details

    • main

      public static void main(String[] args)
    • builder

      public static PyronautCompiler.Builder builder()
      Create a new builder for PyronautCompiler.
      Returns:
      A new builder instance
    • buildClassLoader

      public ClassLoader buildClassLoader()
      Compile the application in-memory and return a ClassLoader containing the compiled classes. This method is used when you want to load and run the application without writing to disk.
      Returns:
      A ClassLoader containing the compiled application classes
      Throws:
      IllegalStateException - if processing fails
    • compile

      public void compile()
      Compile the application to the file system. Requires that targetDir was specified in the builder.
      Throws:
      IllegalStateException - if targetDir is not set or processing fails