Claus Ibsen created CAMEL-27232:
-----------------------------------
Summary: camel-jbang - generated aesh metadata for the CLI
commands (aesh-processor)
Key: CAMEL-27232
URL: https://issues.apache.org/jira/browse/CAMEL-27232
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.25.0
The Camel CLI commands are read by aesh at run time from their annotations
(@CommandDefinition, @Option). The aesh annotation processor (aesh-processor)
generates the metadata at compile time instead, which avoids the annotation
proxy classes the JDK generates at run time.
A prototype on top of CAMEL-27230 (aesh 3.19.2 +
MetadataProviderRegistry.useOnly) gave, median of 15 runs of the launcher:
|| Command || CAMEL-27230 || with generated metadata ||
| camel version | 87 ms | 71 ms |
| camel ps | 92 ms | 79 ms |
| camel get route | 121 ms | 108 ms |
| camel get --help | 125 ms | 97 ms |
| camel --help | 243 ms | 210 ms |
The help and parse golden files of camel-jbang-core are unchanged with the
generated metadata.
What is needed:
* aesh: a release with the fixes of https://github.com/aeshell/aesh/issues/785
(commands without a no-arg constructor, mixin fields the generated class cannot
reach, inaccessible subclasses). The prototype used a patched processor.
* camel-jbang-core: aesh-processor in the compiler annotation processor paths
(not for test compilation), the generated registry in
MetadataProviderRegistry.useOnly, and CommandTree takes the command name and
aliases from the generated metadata instead of reading @CommandDefinition.
* Make the 23 private option fields package-private, so the generated code does
not need reflection for them.
* Later: the same for the plugins with commands (tui, kubernetes, ...).
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)