Annotation processor generating PicoCli API code

10 views
Skip to first unread message

Tako Schotanus

unread,
Jul 6, 2021, 8:14:03 AM7/6/21
to picocli
Hi,

Just in case this might interest anyone, I created an annotation processor that takes an existing project that uses PicoCli annotations and generates code that uses the PicoCli API to recreate the same model:


The code isn't finished because it only implements the PicoCli features we were using in our own project (but we're using quite a number). But it might be useful as a starting point for someone who'd like to do something similar.

Also the code quality is PoC-level because I was only trying to see if model creation time would improve using the API (in our case PicoCli setup is 3/4 of our app startup time so finding a way to improve this is pretty important to us). Unfortunately the gains were pretty minimal so I'll not be working on this any further.

The code for the annotation processor can be found in ... drum roll... /annotation.

Cheers!
-Tako
(Jbang contributor)

Remko Popma

unread,
Jul 14, 2021, 8:37:13 AM7/14/21
to picocli
Sorry for not replying sooner, this dropped below my email horizon...
That sounds great, and also sounds like something that has been on the picocli todo list (https://github.com/remkop/picocli/issues/539).
I have been swamped with other things but I will take a look when I get a breather.

Reply all
Reply to author
Forward
0 new messages