Automatic META-INF/services generation in Scala and SBT for ServiceLoader -
is there way, in scala , sbt, automatically generate meta-inf/services/*
resource files later use java.util.serviceloader
annotating classes, google auto service java projects?
i.e.
package foo.bar import my.exported.serviceinterface @autoservice[serviceinterface] class myservice extends serviceinterface{ // … }
to automatically generate file meta-inf/services/my.exported.serviceinterface
in resources folder. file contain:
foo.bar.myservice
(i don't think can use google auto service directly, doesn't work scala classes -- see this comment on realm-java github issue.)
please consider using https://github.com/nyavro/spi-plugin.
the approach used in plugin differs using annotations - uses whole packages source of interfaces , applies packages of interface implementations.
Comments
Post a Comment