Skip to content

Annotation processor that generates resource-config.json during build #703

@remkop

Description

@remkop

Picocli already offers support for Graal integration with the ReflectionConfigGenerator, ResourceConfigGenerator, and DynamicProxyConfigGenerator tools in the picocli-codegen module.

Similar to #699, this ticket is to improve that to allow picocli-based applications to generate Graal configuration files automatically during the build, and embed the generated files in the client jar so that no command line configuration is needed when creating a native image.

ResourceConfigGenerator

This is a subclass of the generic picocli annotation processor (#500).

It invokes the ResourceConfigGenerator tool with the CommandSpec derived from the annotations at compile time.

By default it generates a config file in this location:

$CLASS_OUTPUT/META-INF/native-image/picocli-generated/resource-config.json

This may be controlled by specifying processor options groupId and artifactId. For example, specifying "-AgroupId=example", "-AartifactId=full" will result in the file location to become:

$CLASS_OUTPUT/META-INF/native-image/example/full/picocli-generated/resource-config.json

(JCommander users looking for Graal support: give this a try!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme: codegenAn issue or change related to the picocli-codegen module

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions