Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea4491e

Browse files
author
Robert McNees
committedMay 28, 2024
Updated build and execute section to make native compilation a feature toggle
1 parent 6359854 commit ea4491e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎build_and_execute_guide.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// optional variables:
77
// network_container - if the generated Docker container needs to run on the same network as an external dependency, this is the name of that container dependency
8-
// custom_hint_include_file - if the native compilation section needs additional description in the form of a custom hint, this is the file that should be rendered as additional content
8+
// omit_native_build - set if the native compilation section is not to be rendered
99

1010
ifeval::["{build_system}" == "gradle"]
1111

@@ -69,14 +69,16 @@ endif::[]
6969

7070
== Building the Application
7171

72-
In this section, we will describe four different ways to run this guide:
72+
This section describes different ways to run this guide:
7373

7474
1. https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.build-systems[Building and executing a JAR file]
7575
2. https://docs.spring.io/spring-boot/docs/current/reference/html/container-images.html#container-images.buildpacks[Building and executing a Docker container using Cloud Native Buildpacks^]
76+
ifndef::omit_native_build[]
7677
3. https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.native-build-tools[Building and executing a native image^]
7778
4. https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.buildpacks[Building and executing a native image container using Cloud Native Buildpacks^]
79+
endif::[]
7880

79-
Regardless of how you choose to execute the application, the output should be the same.
81+
Regardless of how you choose to run the application, the output should be the same.
8082

8183
To run the application, you can package the application as an executable jar.
8284
The `{jar_build_command}` command compiles the application to an executable jar.
@@ -94,6 +96,7 @@ NOTE: The `--network` flag tells Docker to attach our guide container to the exi
9496
You can find more information in the https://docs.docker.com/network/#container-networks[Docker documentation^].
9597
endif::[]
9698

99+
ifndef::omit_native_build[]
97100
=== Native Image Support
98101

99102
Spring Boot also supports https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.introducing-graalvm-native-images[compilation to a native image^], provided you have a GraalVM distribution on your machine.
@@ -106,10 +109,6 @@ plugins {
106109
----
107110
endif::[]
108111

109-
ifdef::custom_hint_include_file[]
110-
include::{custom_hint_include_file}
111-
endif::[]
112-
113112
You can then run the `{native_build_command}` command to generate a native image. When the build completes, you will be able to run the code with a near-instantaneous start up time by executing the `{native_run_command}` command.
114113

115114
ifeval::["{build_system}" == "maven"]
@@ -124,4 +123,5 @@ endif::[]
124123

125124
You can also create a https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.developing-your-first-application.buildpacks[Native Image using Buildpacks^]. You can generate a native image by running the `{native_image_build_command}` command. Once the build completes, you can start your application with the `{native_image_run_command}` command.
126125

127-
126+
endif::[]
127+
//end omit_native_build

0 commit comments

Comments
 (0)