@@ -470,6 +470,7 @@ <h1>Gradle plugin for GraalVM Native Image building</h1>
470
470
</ li >
471
471
< li > < a href ="#testing-support "> Testing support</ a >
472
472
< ul class ="sectlevel2 ">
473
+ < li > < a href ="#test-binary-config "> Configuring test image options</ a > </ li >
473
474
< li > < a href ="#testing-support-disabling "> Disabling testing support</ a > </ li >
474
475
< li > < a href ="#extra-test-suites "> Configuring additional test suites</ a > </ li >
475
476
</ ul >
@@ -710,7 +711,46 @@ <h3 id="_available_tasks"><a class="anchor" href="#_available_tasks"></a>Availab
710
711
< div class ="sect2 ">
711
712
< h3 id ="_native_image_options "> < a class ="anchor " href ="#_native_image_options "> </ a > Native image options</ h3 >
712
713
< div class ="paragraph ">
713
- < p > The < a href ="javadocs/native-gradle-plugin/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.html "> NativeImageOptions</ a > allows you to tweak how the native image is going to be built.</ p >
714
+ < p > The < a href ="javadocs/native-gradle-plugin/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.html "> NativeImageOptions</ a > allows you to tweak how the native image is going to be built.
715
+ The plugin allows configuring the final binary, the < a href ="#test-binary-config "> tests</ a > one, as well as apply options to both.</ p >
716
+ </ div >
717
+ < div class ="listingblock multi-language-sample ">
718
+ < div class ="content ">
719
+ < pre class ="highlightjs highlight "> < code data-lang ="groovy " class ="language-groovy hljs "> graalvmNative {
720
+ binaries {
721
+ main {
722
+ imageName = "my-app"
723
+ mainClass = "org.jackup.Runner"
724
+ buildArgs.add("-O4")
725
+ }
726
+ test {
727
+ buildArgs.add("-O0")
728
+ }
729
+ }
730
+ binaries.all {
731
+ buildArgs.add("--verbose")
732
+ }
733
+ }</ code > </ pre >
734
+ </ div >
735
+ </ div >
736
+ < div class ="listingblock multi-language-sample ">
737
+ < div class ="content ">
738
+ < pre class ="highlightjs highlight "> < code data-lang ="kotlin " class ="language-kotlin hljs "> graalvmNative {
739
+ binaries {
740
+ named("main") {
741
+ imageName.set("my-app")
742
+ mainClass.set("org.jackup.Runner")
743
+ buildArgs.add("-O4")
744
+ }
745
+ named("test") {
746
+ buildArgs.add("-O0")
747
+ }
748
+ }
749
+ binaries.all {
750
+ buildArgs.add("--verbose")
751
+ }
752
+ }</ code > </ pre >
753
+ </ div >
714
754
</ div >
715
755
</ div >
716
756
< div class ="sect2 ">
@@ -1058,6 +1098,38 @@ <h2 id="testing-support"><a class="anchor" href="#testing-support"></a>Testing s
1058
1098
</ div >
1059
1099
</ div >
1060
1100
< div class ="sect2 ">
1101
+ < h3 id ="test-binary-config "> < a class ="anchor " href ="#test-binary-config "> </ a > Configuring test image options</ h3 >
1102
+ < div class ="paragraph ">
1103
+ < p > You can fine-tune the test binary using the < code > test</ code > binary configuration.
1104
+ The following example prints additional data for troubleshooting and sets the minimal optimizations.</ p >
1105
+ </ div >
1106
+ < div class ="listingblock multi-language-sample ">
1107
+ < div class ="content ">
1108
+ < pre class ="highlightjs highlight "> < code data-lang ="groovy " class ="language-groovy hljs "> graalvmNative {
1109
+ binaries {
1110
+ test {
1111
+ buildArgs.addAll('--verbose', '-O0')
1112
+ }
1113
+ }
1114
+ }</ code > </ pre >
1115
+ </ div >
1116
+ </ div >
1117
+ < div class ="listingblock multi-language-sample ">
1118
+ < div class ="content ">
1119
+ < pre class ="highlightjs highlight "> < code data-lang ="kotlin " class ="language-kotlin hljs "> graalvmNative {
1120
+ binaries {
1121
+ named("main") {
1122
+ mainClass.set("org.test.Main")
1123
+ }
1124
+ named("test") {
1125
+ buildArgs.addAll("--verbose", "-O0")
1126
+ }
1127
+ }
1128
+ }</ code > </ pre >
1129
+ </ div >
1130
+ </ div >
1131
+ </ div >
1132
+ < div class ="sect2 ">
1061
1133
< h3 id ="testing-support-disabling "> < a class ="anchor " href ="#testing-support-disabling "> </ a > Disabling testing support</ h3 >
1062
1134
< div class ="paragraph ">
1063
1135
< p > There are cases where you might want to disable native testing support:</ p >
0 commit comments