Class PyronautCompiler
java.lang.Object
io.micronaut.python.compiler.PyronautCompiler
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for PyronautCompiler. -
Method Summary
Modifier and TypeMethodDescriptionCompile the application in-memory and return a ClassLoader containing the compiled classes.static PyronautCompiler.Builderbuilder()Create a new builder for PyronautCompiler.voidcompile()Compile the application to the file system.static void
-
Method Details
-
main
-
builder
Create a new builder for PyronautCompiler.- Returns:
- A new builder instance
-
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
-