Skip to content

Commit

Permalink
Fix Skie Kotlin Compiler Subplugin loading
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSrSouza authored and TadeasKriz committed Jun 27, 2024
1 parent beb6530 commit ac19bf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import java.util.ServiceLoader

class SkiePluginLoader {

val pluginRegistrars: List<SkiePluginRegistrar> = ServiceLoader.load(SkiePluginRegistrar::class.java).toList()
val pluginRegistrars: List<SkiePluginRegistrar> = ServiceLoader.load(
SkiePluginRegistrar::class.java,
SkiePluginRegistrar::class.java.classLoader
).toList()

fun registerAll(initPhaseContext: InitPhase.Context) {
pluginRegistrars.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object PhaseInterceptorRegistrar {

val phaseInterceptors =
(this::class.java.classLoader as? URLClassLoader)?.let { ServiceLoaderLite.loadImplementations(it) }
?: ServiceLoader.load(PhaseInterceptor::class.java)
?: ServiceLoader.load(PhaseInterceptor::class.java, this::class.java.classLoader)

phaseInterceptors
.groupBy { it.getInterceptedPhase() }
Expand Down

0 comments on commit ac19bf5

Please sign in to comment.