avaje / avaje-inject

Dependency injection via APT (source code generation) ala "Server-Side Dagger DI"
https://avaje.io/inject
Apache License 2.0
227 stars 21 forks source link

Process Avaje SPI @ServiceProvider for writing service META-INF/services file entry #624

Closed SentryMan closed 2 months ago

SentryMan commented 2 months ago

Developers looking to extend avaje-inject via one of InjectExtension interfaces can register the service implementation manually via src/main/resources/META-INF/services/io.avaje.inject.spi.InjectExtension.

With this change, alternatively the Developer can use avaje-spi-service and annotate the service implementation with @ServiceProvider - then the entry will be automatically created in the target/classes/META-INF/services/io.avaje.inject.spi.InjectExtension. The avaje-inject-generator will detect the extension and add it to the services that it needs to register.


A potential alternative to #622 wherein inject will process the avaje-spi annotations instead of creating a new one.

avaje spi would also help validate that the structure of the service itself is good (public no-args constructor and the like)

relies on https://github.com/avaje/avaje-spi-service/pull/27

rbygrave commented 2 months ago

@SentryMan I'll merge this in and we can adjust as necessary if any of my changes were not correct.