Add AotDetector to reliably opt-in for optimizations

This commit adds a central utility to figure out if the application
must run with Ahead-Of-Time optimizations. This is mandatory for running
in a native image but can be selected on the JVM using the
"spring.aot.enabled" property.

This commit also introduces a utility that can be used to initialize a
context with generated artifacts. This represents the runtime
counterpart of ApplicationContextAotGenerator.

Closes gh-28474
This commit is contained in:
Stephane Nicoll
2022-05-31 13:22:21 +02:00
parent 8af1496b37
commit da8c4de263
4 changed files with 229 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
Args = --initialize-at-build-time=org.springframework.core.NativeDetector \
Args = --initialize-at-build-time=org.springframework.aot.AotDetector \
--initialize-at-build-time=org.springframework.core.NativeDetector \
--initialize-at-build-time=org.springframework.util.unit.DataSize