public final class MicronautAotOptimizer extends java.lang.Object implements ConfigKeys
StaticOptimizations
class.
The Micronaut AOT optimizer is experimental and won't do
anything by its own: it must be integrated in some form, for
example via a build plugin, which in turn will make the generated
classes visible to the user. For example, the build tool may
call this class to generate the optimization code, and in addition
create an optimized jar, an optimized native binary or even a
full distribution.
The optimizer works by passing in the whole application runtime
classpath and a set of configuration options. It then analyzes
the classpath, for example to identify the services to be loaded,
or to provide some alternative implementations to existing
classes.Modifier and Type | Class and Description |
---|---|
static class |
MicronautAotOptimizer.Runner
The main AOT optimizer runner.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OUTPUT_RESOURCES_FILE_NAME |
CLASSPATH, GENERATED_PACKAGE, OUTPUT_DIRECTORY, RUNTIME
Modifier and Type | Method and Description |
---|---|
static void |
execute(java.util.Properties props)
This convenience method uses properties to load the configuration.
|
static void |
exportConfiguration(java.lang.String runtime,
java.io.File propertiesFile)
Scans the list of available optimization services and generates
a configuration file which includes all entries.
|
static MicronautAotOptimizer.Runner |
runner(java.lang.String generatedPackage,
java.io.File outputSourcesDirectory,
java.io.File outputClassesDirectory,
java.io.File logsDirectory,
Configuration config) |
public static final java.lang.String OUTPUT_RESOURCES_FILE_NAME
public static void exportConfiguration(java.lang.String runtime, java.io.File propertiesFile)
runtime
- the runtime for which to generate a properties filepropertiesFile
- the generated properties filepublic static void execute(java.util.Properties props)
props
- the configuration propertiespublic static MicronautAotOptimizer.Runner runner(java.lang.String generatedPackage, java.io.File outputSourcesDirectory, java.io.File outputClassesDirectory, java.io.File logsDirectory, Configuration config)