diff --git a/docs/src/docs/asciidoc/end-to-end-gradle-guide.adoc b/docs/src/docs/asciidoc/end-to-end-gradle-guide.adoc index 26a7f2c6..d1427373 100644 --- a/docs/src/docs/asciidoc/end-to-end-gradle-guide.adoc +++ b/docs/src/docs/asciidoc/end-to-end-gradle-guide.adoc @@ -6,6 +6,7 @@ The GraalVM team This guide leads you through the process of integrating Native Gradle Plugin with your project. It starts from adding the plugin to your project, goes through some of the main functionalities that you may use (like collecting the metadata), all the way to some diagnostics tools that you can use to analyse native executables you have made. +You can see an example of tests on which we tested whole guide <>. In case you only want to see how a simple application works in practise, you can check <>. @@ -178,10 +179,10 @@ Inside these blocks you can pass the following options: - `jvmArgs` - Passes the given argument directly to the JVM running the native image builder - `useFatJar` - Instead of passing each jar individually, builds a fat jar -You can also pass **build-time** and **run-time** options to the Native Image using: +You can also pass **build-time** and **run-time** arguments: -- `buildArgs.add('')` - You can find more about possible build arguments https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/[here] -- `runtimeArgs.add('')` - You can find more about possible runtime arguments https://www.graalvm.org/latest/reference-manual/native-image/overview/Options/[here] +- `buildArgs.add('')` - You can find more about possible build arguments https://www.graalvm.org/latest/reference-manual/native-image/overview/Options/[here] and https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/[here] +- `runtimeArgs.add('')` - Runtime arguments consumed by your application Here is an example of additional options usage: @@ -258,9 +259,9 @@ The easiest way how this information can be passed to the Native Image is throug a single `reachability-metadata.json` file (for newer GraalVM versions) or multiple json files (`reflect-config.json`, `resource-config.json`, `proxy-config.json`, `serialization-config.json`, `jni-config.json`). To learn more about metadata that Native Image consumes, https://www.graalvm.org/latest/reference-manual/native-image/metadata/[see this]. -For example, if you run the test that tries to load resource `resource.txt`, and you don't have entry for that resource in the metadata config file, the resource can't be loaded (will be null). +For example, if you run the test that uses the reflection, and you don't have entry for that reflection call in the metadata config file, your test will fail. -To make your test/application work while using resources (like in this example) or other metadata, you should either generate metadata configurations or write them manually. +To make your test/application work while using reflection (like in this example) or other metadata, you should either generate metadata configurations or write them manually. To generate metadata automatically, you can run your tests (or the main application) with the Native Image Agent, that will collect all the metadata your test/application require. To enable the agent (through Native Gradle Plugin) you should either: @@ -291,8 +292,6 @@ agent { [.underline]#To generate the metadata file(s) for your `application` just run:# - `./gradlew run` if you added the agent block to the configuration or `./gradlew -Pagent run` if you didn't. This command runs on JVM with native-image-agent and collects the metadata. -- `./gradlew nativeRun` if you added the agent block to the configuration or `./gradlew -Pagent nativeRun` if you didn't. This command runs on JVM with the native-image agent, collects the metadata and uses it for testing on native-image. - [WARNING] ==== @@ -380,7 +379,7 @@ Besides that, you can configure `metadataCopy` task through the command line as Here is an example of a valid `metadataCopy` usage: -[source,bash,subs="verbatim,attributes"] +[source,bash,subs="verbatim,attributes", role="multi-language-sample"] ---- ./gradlew metadataCopy --task test --dir resources/META-INF/native-image/org.example ---- @@ -414,9 +413,9 @@ First thing that you can configure is the agent mode. There are three possible agent modes: * `standard` - only generates metadata without any special processing (this is the default mode). No additional options available. -* `conditional` - entries of the generated metadata will be included in the Native Image only if the condition in the entry is satisfied. Consumes following additional options: +* `conditional` - entries of the generated metadata will be included in the Native Image only if the condition in the entry is satisfied. Consumes following options: ** `userCodeFilterPath` - specifies a filter file used to classify classes as user application classes. Generated conditions will only reference these classes See <> -** `extraFilterPath` - extra filter used to further filter the collected metadata. See <> +** `extraFilterPath` - (optional) extra filter used to further filter the collected metadata. See <> * `direct` - in this mode user configures the agent completely manually by adding all options with: ** `options.add("