Closed SentryMan closed 2 months ago
Feel free to change the names of the annotations to something else
Trying to auto-register services with avaje-spi is a dead end.
Why? What has gone wrong?
Trying to auto-register services with avaje-spi is a dead end.
Why? What has gone wrong?
I thought it was good too, but it has a fatal flaw in that if multiple annotation processors try to use this, not all of the processor's spi interfaces will get registered. The reason is that the spi processor must be the last processor to execute after processing is over.
Trying to wrangle the apt order causes more work, not less.
So I suppose we need to make spi annotation for the generators.
Or not? In that there are several options to consider now right?
What we know is that we need the inject-generator AP to write it's META-INF/services and not delegate that to avaje-spi-service (due to unknown ordering of the APs). Now if inject-generator AP appends to META-INF/services (and does not override) then this allows traditional manual registration of any InjectExtension. Does that not work?
Does that not work?
that's what #621 is for. This one is because I don't like manually writing services and avaje-spi can't be used to automate this
that's what https://github.com/avaje/avaje-inject/pull/621 is for.
Yes, got that now. I saw the emails and saw the "Trying to auto-register services with avaje-spi is a dead end." ... so I came here first (so yeah I missed the previous part of the story there).
hmm, an alternate strategy would be to annotation process the avaje-spi @ServiceProvider
and modify avaje-spi-service such that it'll abort writing any of the spis claimed by our generators
It is generally the case for avaje-inject that the only folks registering a service will be InjectPlugin authors right? Like there might be better cases like avaje-validation but its not got good bang for buck here for avaje-inject as I see it.
It is generally the case for avaje-inject that the only folks registering a service will be InjectPlugin authors right?
Even so, writing services is tedious. In any case, don't forget those who may want to use the Property Plugin spi or fiddle with custom module ordering logic.
Trying to auto-register services with avaje-spi is a dead end. So I suppose we need to make spi annotation for the generators.