Class AotCacheTrainingExtension
java.lang.Object
io.github.vpelikh.aot.gradle.AotCacheTrainingExtension
Configuration for the
io.github.vpelikh.aot-cache-training plugin.
aotCacheTraining {
enabled = true
packagesToScan = ['com.example']
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.Property<Boolean> Whether to record a cache even when the training run discovers no tests.abstract org.gradle.api.provider.ListProperty<String> Arguments passed to the application during training (for example, to set a Spring profile).abstract org.gradle.api.provider.Property<String> An optional container image whose JVM records the cache.abstract org.gradle.api.provider.Property<String> The container runtime executable used whengetContainerImage()is set.abstract org.gradle.api.provider.Property<Boolean> Whether AOT cache recording is enabled.abstract org.gradle.api.provider.Property<Boolean> Whether a failing test should fail the training run.abstract org.gradle.api.provider.ListProperty<String> Packages whose tests form the training workload.abstract org.gradle.api.provider.Property<String> A URL polled until it returns a 2xx/3xx response, used as the readiness check and the base URL for the training run.abstract org.gradle.api.provider.Property<String> The application start class used for training.abstract org.gradle.api.provider.Property<Integer> How long to wait for the application to become ready during training, in seconds.
-
Constructor Details
-
AotCacheTrainingExtension
public AotCacheTrainingExtension()Create the extension. Gradle instantiates it and injects the managed properties.
-
-
Method Details
-
getEnabled
Whether AOT cache recording is enabled. Defaults tofalseso the plugin is inert until a user opts in.- Returns:
- the enabled property
-
getPackagesToScan
Packages whose tests form the training workload. When empty, the whole test class path is scanned.- Returns:
- the packages to scan
-
getFailOnTestFailure
Whether a failing test should fail the training run. Defaults totrue; usefalseto record a cache even when some integration tests fail.- Returns:
- the fail-on-test-failure property
-
getAllowEmptyWorkload
Whether to record a cache even when the training run discovers no tests. Defaults tofalse, because an empty workload records a large but useless cache and is almost always a misconfiguration.- Returns:
- the allow-empty-workload property
-
getReadyUrl
A URL polled until it returns a 2xx/3xx response, used as the readiness check and the base URL for the training run. The packaged application is driven over HTTP, so the tests read this base URL from theaot.training.urlsystem property. Defaults tohttp://localhost:8080/.- Returns:
- the readiness URL property
-
getStartClass
The application start class used for training. When unset, it is read from the packaged JAR'sStart-Classmanifest attribute.- Returns:
- the start-class property
-
getContainerImage
An optional container image whose JVM records the cache. Set this when the cache must be loaded by an image whose JVM differs from the build host (a different JDK distribution or version, or a different architecture, which is the common case when building on, for example, macOS arm64 and deploying a linux/amd64 image). The packaged application then runs inside that image and the recorded cache matches the image's JVM build and architecture.When unset (the default), the packaged application records against the local JVM instead. The cache is then only loadable by that same local JVM build and architecture, so leave it unset only when the runtime JVM matches the build host.
- Returns:
- the container-image property
-
getContainerRuntime
The container runtime executable used whengetContainerImage()is set. Defaults todocker.- Returns:
- the container-runtime property
-
getApplicationArguments
Arguments passed to the application during training (for example, to set a Spring profile).- Returns:
- the application-arguments property
-
getStartTimeout
How long to wait for the application to become ready during training, in seconds. Defaults to120.- Returns:
- the start-timeout property
-