Skip to content

Commit

Permalink
Fixing broken links (docu, javadoc)
Browse files Browse the repository at this point in the history
  • Loading branch information
deining authored and remkop committed Sep 2, 2022
1 parent 7c51f96 commit 30c88e9
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The full set of https://www.graalvm.org/reference-manual/native-image/Limitation
Two limitations are of particular interest:

* https://www.graalvm.org/reference-manual/native-image/Limitations/#reflection[reflection]
* https://www.graalvm.org/reference-manual/native-image/Resources/[resources]
* https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources]

Basically, to create a self-contained binary, the native image compiler needs to know up-front all the classes of your application, their dependencies, and the resources they use. Reflection and resource bundles often require configuration. We will see an example of this later on.

Expand Down Expand Up @@ -198,7 +198,7 @@ Next, let’s take a look at turning it into a native executable.

=== Reflection Configuration

We mentioned earlier that the native image compiler has some limitations: reflection is supported but https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[requires configuration].
We mentioned earlier that the native image compiler has some limitations: reflection is supported but https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[requires configuration].

This impacts picocli-based applications: at runtime, picocli uses reflection to discover any `@Command`-annotated subcommands, and the `@Option` and `@Parameters`-annotated command options and positional parameters.

Expand Down Expand Up @@ -239,7 +239,7 @@ This quickly becomes quite cumbersome for utilities with many options, but fortu
The `picocli-codegen` module includes an annotation processor that can build a model from the picocli annotations at compile time rather than at runtime.

The annotation processor generates Graal configuration files under `META-INF/native-image/picocli-generated/$project` during compilation, to be included in the application jar.
This includes configuration files for https://www.graalvm.org/reference-manual/native-image/Reflection/[reflection], https://www.graalvm.org/reference-manual/native-image/Resources/[resources] and https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[dynamic proxies].
This includes configuration files for https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[reflection], https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources] and https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[dynamic proxies].
By embedding these configuration files, your jar is instantly Graal-enabled.
In most cases no further configuration is needed when generating a native image.

Expand Down
10 changes: 5 additions & 5 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ The `picocli-codegen` module includes an annotation processor that can build a m
Enabling this annotation processor in your project is optional, but strongly recommended. Use this if you’re interested in:

* **Compile time error checking**. The annotation processor shows errors for invalid annotations and attributes immediately when you compile, instead of during testing at runtime, resulting in shorter feedback cycles.
* **<<GraalVM Native Image,GraalVM native images>>**. The annotation processor generates and updates https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[GraalVM configuration] files under
* **<<GraalVM Native Image,GraalVM native images>>**. The annotation processor generates and updates https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[GraalVM configuration] files under
`META-INF/native-image/picocli-generated/$project` during compilation, to be included in the application jar.
This includes configuration files for https://www.graalvm.org/reference-manual/native-image/Reflection/[reflection], https://www.graalvm.org/reference-manual/native-image/Resources/[resources] and https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[dynamic proxies].
This includes configuration files for https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[reflection], https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources] and https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[dynamic proxies].
By embedding these configuration files, your jar is instantly Graal-enabled.
In most cases no further configuration is needed when generating a native image.

Expand Down Expand Up @@ -12849,8 +12849,8 @@ ahead-of-time compile Java code to a standalone executable, called a native imag
The resulting executable includes the application, the libraries, and the JDK and does not require a separate Java VM to be installed.
The generated native image has faster startup time and lower runtime memory overhead compared to a Java VM.

GraalVM native images have some limitations and require some extra https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[configuration]
to be able to use features like https://www.graalvm.org/reference-manual/native-image/Reflection/[reflection], https://www.graalvm.org/reference-manual/native-image/Resources/[resources] (including resource bundles) and https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[dynamic proxies].
GraalVM native images have some limitations and require some extra https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[configuration]
to be able to use features like https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[reflection], https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources] (including resource bundles) and https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[dynamic proxies].

==== How do I Create a Native Image for my Application?
The `picocli-codegen` module contains an annotation processor that generates the necessary configuration files
Expand All @@ -12859,7 +12859,7 @@ to be included in the application jar. The <<Annotation Processor>> section of t
file.

By embedding these configuration files, your jar is instantly Graal-enabled: the
https://www.graalvm.org/docs/reference-manual/aot-compilation/#install-native-image[`native-image` tool]
https://www.graalvm.org/22.2/reference-manual/native-image/#install-native-image[`native-image` tool]
used to generate the native executable is able to get the configuration from the jar.
In most cases no further configuration is needed when generating a native image.

Expand Down
2 changes: 1 addition & 1 deletion docs/picocli-on-graalvm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The generated `reflect.json` files looks something like this:
TIP: If necessary, it is possible to exclude classes with system property `picocli.codegen.excludes`, which accepts a comma-separated list of regular expressions of the fully qualified class names that should not be included in the resulting JSON String.

=== Compiling a Native Image
This assumes you have GraalVM installed, with prerequisites. From https://www.graalvm.org/docs/reference-manual/aot-compilation/[the site]:
This assumes you have GraalVM installed, with prerequisites. From https://www.graalvm.org/22.2/reference-manual/native-image/[the site]:

[quote]
____
Expand Down
2 changes: 1 addition & 1 deletion gradle/docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ javadoc {
javadoc.dependsOn(jar)
javadoc.dependsOn('asciidoctor')
asciidoctorj {
version = '2.5.3'
version = '2.5.5'
}
asciidoctor {
sourceDir = file('docs')
Expand Down
28 changes: 14 additions & 14 deletions picocli-codegen/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If a tool does not have an annotation processor wrapper (yet), it can be invoked
As of picocli version 4.2, this module has three major use cases:

* **Compile time error checking**. The annotation processor shows errors for invalid annotations and attributes immediately when you compile, instead of during testing at runtime, resulting in shorter feedback cycles.
* **GraalVm native images**. To create a GraalVM native image for a picocli application, https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[configuration] is needed. The `ReflectionConfigGenerator`, `ResourceConfigGenerator` and `DynamicProxyGenerator` tools can generate `reflect-config.json`, `resource-config.json` and `proxy-config.json` configuration files for https://www.graalvm.org/reference-manual/native-image/Reflection/[reflection], https://www.graalvm.org/reference-manual/native-image/Resources/[resources] and https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[dynamic proxies], respectively.
* **GraalVm native images**. To create a GraalVM native image for a picocli application, https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[configuration] is needed. The `ReflectionConfigGenerator`, `ResourceConfigGenerator` and `DynamicProxyGenerator` tools can generate `reflect-config.json`, `resource-config.json` and `proxy-config.json` configuration files for https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[reflection], https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources] and https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[dynamic proxies], respectively.
+
The annotation processor embeds these three tools and generates the configuration files under `META-INF/native-image/picocli-generated/$project` during compilation, to be included in the application jar.
By embedding these configuration files, your jar is instantly GraalVM-enabled.
Expand All @@ -43,10 +43,10 @@ To build a GraalVM native image for a picocli-based application, configuration f
The `picocli-codegen` module has tools that generate these configuration files for a picocli-based application.
The annotation processor in the `picocli-codegen` jar wraps these tools so they are executed automatically during compilation.

The annotation processor generates and updates https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[GraalVM configuration]
The annotation processor generates and updates https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[GraalVM configuration]
files under `META-INF/native-image/picocli-generated/$project` during compilation,
to be included in the application jar.
This includes configuration files for https://www.graalvm.org/reference-manual/native-image/Reflection/[reflection], https://www.graalvm.org/reference-manual/native-image/Resources/[resources] and https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[dynamic proxies].
This includes configuration files for https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[reflection], https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[resources] and https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[dynamic proxies].
By embedding these configuration files, your jar is instantly GraalVM-enabled.

In most cases no further configuration is needed when generating a native image.
Expand Down Expand Up @@ -285,19 +285,19 @@ This directory (or any of its subdirectories) is searched for files with the nam
which are then automatically included in the build. Not all of those files must be present.
When multiple files with the same name are found, all of them are included.

See also the SubstrateVM https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/[configuration documentation].
See also the SubstrateVM https://www.graalvm.org/22.2/reference-manual/native-image/overview/BuildConfiguration/[configuration documentation].

=== ReflectionConfigGenerator

GraalVM has https://www.graalvm.org/reference-manual/native-image/Reflection/[limited support for Java reflection]
GraalVM has https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Reflection/[limited support for Java reflection]
and it needs to know ahead of time the reflectively accessed program elements.

`ReflectionConfigGenerator` generates a JSON String with the program elements that will be accessed reflectively in a picocli-based application, in order to compile this application ahead-of-time into a native executable with GraalVM.

The <<Generate Documentation,generated>> manual page for the `ReflectionConfigGenerator` tool https://picocli.info/man/gen-reflect-config.html[is here].

The output of `ReflectionConfigGenerator` is intended to be passed to the `-H:ReflectionConfigurationFiles=/path/to/reflect-config.json` option of the `native-image` GraalVM utility,
or placed in a `META-INF/native-image/` subdirectory of the JAR.
or placed in a `META-INF/native-image/` subdirectory of the JAR.

This allows picocli-based applications to be compiled to a native image.

Expand All @@ -309,7 +309,7 @@ _Note that the <<Generate GraalVM Configurations with the Annotation Processor,a

The `--output` option can be used to specify the path of the file to write the configuration to.
When this option is omitted, the output is sent to standard out.

The `ReflectionConfigGenerator` tool accepts any number of fully qualified class names of command classes
(classes with picocli annotations like `@Command`, `@Option` and `@Parameters`).
The resulting configuration file will contain entries for the reflected elements of all specified classes.
Expand Down Expand Up @@ -397,15 +397,15 @@ assemble.dependsOn generateGraalReflectionConfig
=== ResourceConfigGenerator

The GraalVM native-image builder by default will not integrate any of the
https://www.graalvm.org/reference-manual/native-image/Resources/[classpath resources] into the image it creates.
https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/Resources/[classpath resources] into the image it creates.

`ResourceConfigGenerator` generates a JSON String with the resource bundles and other classpath resources
that should be included in the Substrate VM native image.

The <<Generate Documentation,generated>> manual page for the `ResourceConfigGenerator` tool https://picocli.info/man/gen-resource-config.html[is here].

The output of `ResourceConfigGenerator` is intended to be passed to the `-H:ResourceConfigurationFiles=/path/to/resource-config.json` option of the `native-image` GraalVM utility,
or placed in a `META-INF/native-image/` subdirectory of the JAR.
or placed in a `META-INF/native-image/` subdirectory of the JAR.

This allows picocli-based native image applications to access these resources.

Expand All @@ -415,7 +415,7 @@ _Note that the <<Generate GraalVM Configurations with the Annotation Processor,a

The `--output` option can be used to specify the path of the file to write the configuration to.
When this option is omitted, the output is sent to standard out.

The `ResourceConfigGenerator` tool accepts any number of fully qualified class names of command classes
(classes with picocli annotations like `@Command`, `@Option` and `@Parameters`).
The resulting configuration file will contain entries for the resource bundles used in any of the specified commands or their subcommands.
Expand Down Expand Up @@ -504,8 +504,8 @@ assemble.dependsOn generateGraalResourceConfig

=== DynamicProxyConfigGenerator

Substrate VM doesn't provide machinery for generating and interpreting bytecodes at run time. Therefore all dynamic proxy classes
https://www.graalvm.org/reference-manual/native-image/DynamicProxy/[need to be generated] at native image build time.
Substrate VM doesn't provide machinery for generating and interpreting bytecodes at run time. Therefore all dynamic proxy classes
https://www.graalvm.org/22.2/reference-manual/native-image/dynamic-features/DynamicProxy/[need to be generated] at native image build time.

`DynamicProxyConfigGenerator` generates a JSON String with the fully qualified interface names for which
dynamic proxy classes should be generated at native image build time.
Expand All @@ -524,7 +524,7 @@ _Note that the <<Generate GraalVM Configurations with the Annotation Processor,a

The `--output` option can be used to specify the path of the file to write the configuration to.
When this option is omitted, the output is sent to standard out.

The `DynamicProxyConfigGenerator` tool accepts any number of fully qualified class names of command classes
(classes with picocli annotations like `@Command`, `@Option` and `@Parameters`).
The resulting configuration file will contain entries for the resource bundles used in any of the specified commands or their subcommands.
Expand Down Expand Up @@ -785,7 +785,7 @@ This generates AsciiDoc files with the 'manpage' doctype in `build/generated/doc
CAUTION: Do this only once, then remove the `--template-dir` option, so that subsequent `ManPageGenerator` invocations will only update the generated manpage AsciiDoc files and will not overwrite the template files.

CAUTION: If the `ManPageGenerator` tool detects an existing template file, it will abort with an error (and exit code 4).
The existing template will not be overwritten unless the `--force` option is specified.
The existing template will not be overwritten unless the `--force` option is specified.

We can now edit the files in `src/docs/man-templates` and tell the `asciidoctor` tool to generate HTML and man page files in troff format from the files in `src/docs/man-templates`.

Expand Down
Loading

0 comments on commit 30c88e9

Please sign in to comment.