Add support for invoking AOT to the Gradle plugin

Closes gh-30527
This commit is contained in:
Andy Wilkinson
2022-04-06 12:01:33 +01:00
parent fd7bb53180
commit fcf45d5c22
16 changed files with 413 additions and 9 deletions

View File

@@ -39,6 +39,7 @@ v{gradle-project-version}
:buildpacks-reference: https://buildpacks.io/docs
:paketo-reference: https://paketo.io/docs
:paketo-java-reference: {paketo-reference}/buildpacks/language-family-buildpacks/java
:nbt-gradle-plugin: https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html

View File

@@ -63,3 +63,16 @@ When Gradle's {application-plugin}[`application` plugin] is applied to a project
5. Configures the `bootJar` task to use the `mainClassName` property as a convention for the `Start-Class` entry in its manifest.
6. Configures the `bootWar` task to use the `mainClassName` property as a convention for the `Start-Class` entry in its manifest.
[[reacting-to-other-plugins.nbt]]
== Reacting to the GraalVM Native Image Plugin
When the {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied to a project, the Spring Boot plugin:
. Applies the `org.springframework.boot.aot` plugin that:
.. Registers a `GenerateAotSources` task named `generateAotSources` that will generate AOT-optimized source code for the application.
.. Configures the Java compilation and process resources tasks for the `aot` source set to depend upon `generateAotSources`.
. Adds the output of the `aot` source set to the classpath of the `nativeCompile` task.
. Configures the GraalVM extension to disable Toolchain detection.