Class AotCacheTrainingExtension

java.lang.Object
io.github.vpelikh.aot.gradle.AotCacheTrainingExtension

public abstract class AotCacheTrainingExtension extends Object
Configuration for the io.github.vpelikh.aot-cache-training plugin.
aotCacheTraining {
    enabled = true
    packagesToScan = ['com.example']
}
  • Constructor Details

    • AotCacheTrainingExtension

      public AotCacheTrainingExtension()
      Create the extension. Gradle instantiates it and injects the managed properties.
  • Method Details

    • getEnabled

      public abstract org.gradle.api.provider.Property<Boolean> getEnabled()
      Whether AOT cache recording is enabled. Defaults to false so the plugin is inert until a user opts in.
      Returns:
      the enabled property
    • getPackagesToScan

      public abstract org.gradle.api.provider.ListProperty<String> getPackagesToScan()
      Packages whose tests form the training workload. When empty, the whole test class path is scanned.
      Returns:
      the packages to scan
    • getFailOnTestFailure

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnTestFailure()
      Whether a failing test should fail the training run. Defaults to true; use false to record a cache even when some integration tests fail.
      Returns:
      the fail-on-test-failure property
    • getAllowEmptyWorkload

      public abstract org.gradle.api.provider.Property<Boolean> getAllowEmptyWorkload()
      Whether to record a cache even when the training run discovers no tests. Defaults to false, because an empty workload records a large but useless cache and is almost always a misconfiguration.
      Returns:
      the allow-empty-workload property
    • getReadyUrl

      public abstract org.gradle.api.provider.Property<String> 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 the aot.training.url system property. Defaults to http://localhost:8080/.
      Returns:
      the readiness URL property
    • getStartClass

      public abstract org.gradle.api.provider.Property<String> getStartClass()
      The application start class used for training. When unset, it is read from the packaged JAR's Start-Class manifest attribute.
      Returns:
      the start-class property
    • getContainerImage

      public abstract org.gradle.api.provider.Property<String> 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

      public abstract org.gradle.api.provider.Property<String> getContainerRuntime()
      The container runtime executable used when getContainerImage() is set. Defaults to docker.
      Returns:
      the container-runtime property
    • getApplicationArguments

      public abstract org.gradle.api.provider.ListProperty<String> getApplicationArguments()
      Arguments passed to the application during training (for example, to set a Spring profile).
      Returns:
      the application-arguments property
    • getStartTimeout

      public abstract org.gradle.api.provider.Property<Integer> getStartTimeout()
      How long to wait for the application to become ready during training, in seconds. Defaults to 120.
      Returns:
      the start-timeout property