Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
remkop opened this issue May 23, 2019 · 1 comment
Closed
Labels
theme: codegen An issue or change related to the picocli-codegen module
Milestone

Comments

@remkop
Copy link
Owner

remkop commented May 23, 2019

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!)

@remkop remkop added the theme: codegen An issue or change related to the picocli-codegen module label May 23, 2019
@remkop remkop added this to the 4.0-beta-1 milestone May 23, 2019
remkop added a commit that referenced this issue May 23, 2019
remkop added a commit that referenced this issue May 23, 2019
remkop added a commit that referenced this issue May 24, 2019
* fixed resource bundle related bugs in CommandLine (bundle may be null while bundleBaseName is not null in annotation processors)
* all annotation processors now support a `relative.path` option (replaces the `groupId` and `artifactId` options)
* DynamicProxyConfigGeneratorProcessor now supports a `interfaceClasses` option for additional interface names
* ResourceConfigGeneratorProcessor now supports a `bundles` option for additional resource bundles and a `resourceRegex` option for additional other resources
* added tests
remkop added a commit that referenced this issue May 24, 2019
remkop added a commit that referenced this issue May 26, 2019
@remkop remkop closed this as completed in fa0f41b May 26, 2019
@remkop
Copy link
Owner Author

remkop commented Jun 1, 2019

Remaining tasks:

  • update README for picocli-codegen subproject: annotation processor
  • add section to user manual on creating native images with GraalVM
  • add README for picocli-annotation-processor-tests subproject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: codegen An issue or change related to the picocli-codegen module
Projects
None yet
Development

No branches or pull requests

1 participant