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 should allow @Spec-annotated field in version provider #1134

Closed
remkop opened this issue Jul 23, 2020 · 0 comments
Closed
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Jul 23, 2020

Picocli 4.2.0 added support for injecting CommandSpec into custom IVersionProvider implementation classes.

However, the annotation processor raises a compile-time error with message @Spec must be enclosed in a @Command, but was <class> when a IVersionProvider implementation class has a @Spec-annotated field.

(picocli-codegen/src/main/java/picocli/codegen/annotation/processing/AbstractCommandSpecProcessor.java, line 843).

The workaround is to use variables like ${COMMAND-NAME} or ${COMMAND-FULL-NAME} in the returned version string.

@remkop remkop added this to the 4.5 milestone Jul 23, 2020
@remkop remkop modified the milestones: 4.5, 4.4.1 Jul 29, 2020
@remkop remkop closed this as completed in 63065d7 Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant