@org.gradle.api.tasks.CacheableTask @groovy.transform.CompileStatic abstract class ExtractApplicationTask extends DefaultTask
Unpacks an executable jar into the form an AOT cache is read against.
An executable jar loads its dependencies through a nested-jar class loader; the extracted form loads them as ordinary jars on the classpath. A cache records the class path it saw, so only the second is a layout a later run can reuse one against.
The work is done through injected services rather than through the project, so that nothing is reached at execution time that the configuration cache forbids.
| Constructor and description |
|---|
ExtractApplicationTask() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
extract() |
|
abstract RegularFileProperty |
getArchiveFile()The archive to unpack, which has to be the one the cache will be trained against. |
|
abstract DirectoryProperty |
getDestination() |
|
abstract ExecOperations |
getExecOperations() |
|
abstract FileSystemOperations |
getFileSystemOperations() |
|
abstract Property<JavaLauncher> |
getJavaLauncher()The Java runtime to unpack with. |
The archive to unpack, which has to be the one the cache will be trained against.
The Java runtime to unpack with. Its jarmode does the extracting, so it is the JDK the
application was built for rather than whichever one is running Gradle.
Nested rather than the path as an input. A path is where a JDK happens to live on the machine that ran the build, so declaring it as an input puts that machine into this task's cache key -- and a cacheable task that can only ever be hit on the machine that filled it is not one. Nested fingerprints what the launcher says about itself, which is the part that changes the result.