Class EmbedAotCacheTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.vpelikh.aot.gradle.EmbedAotCacheTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class EmbedAotCacheTask extends org.gradle.api.DefaultTask
Copies a Spring Boot application JAR and adds the recorded AOT cache as an aot-cache/application.aot entry, so bootBuildImage ships the cache.

The embedding (entry layout and POSIX modes) is performed by AotCache.embedCacheIntoJar(Path, Path, Path); see there for why the modes matter.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create the task.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Copy the boot JAR and append the cache entry.
    abstract org.gradle.api.file.RegularFileProperty
    The Spring Boot application JAR to copy.
    abstract org.gradle.api.file.RegularFileProperty
    The recorded AOT cache to embed.
    abstract org.gradle.api.file.RegularFileProperty
    The application JAR with the cache embedded.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getLoggingManager, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • EmbedAotCacheTask

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

    • getBootJar

      @InputFile @PathSensitive(NONE) public abstract org.gradle.api.file.RegularFileProperty getBootJar()
      The Spring Boot application JAR to copy.
      Returns:
      the boot JAR property
    • getCacheFile

      @InputFile @PathSensitive(NONE) public abstract org.gradle.api.file.RegularFileProperty getCacheFile()
      The recorded AOT cache to embed.
      Returns:
      the cache file property
    • getOutputJar

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getOutputJar()
      The application JAR with the cache embedded.
      Returns:
      the output JAR property
    • embed

      public void embed() throws IOException
      Copy the boot JAR and append the cache entry.
      Throws:
      IOException - if the JARs cannot be read or written