dev.mokkery.plugin.MokkeryCompilerPluginRegistrar.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mokkery-plugin Show documentation
Show all versions of mokkery-plugin Show documentation
Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
The newest version!
package dev.mokkery.plugin
import com.google.auto.service.AutoService
import dev.mokkery.plugin.diagnostics.MokkeryDiagnosticRendererFactory
import dev.mokkery.plugin.jvm.MokkeryClassGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.jvm.extensions.ClassGeneratorExtension
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter
@AutoService(CompilerPluginRegistrar::class)
class MokkeryCompilerPluginRegistrar : CompilerPluginRegistrar() {
override val supportsK2: Boolean = true
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
IrGenerationExtension.registerExtension(MokkeryIrGenerationExtension(configuration))
FirExtensionRegistrarAdapter.registerExtension(MokkeryFirRegistrar(configuration))
RootDiagnosticRendererFactory.registerFactory(MokkeryDiagnosticRendererFactory())
ClassGeneratorExtension.registerExtension(MokkeryClassGenerationExtension(configuration))
}
}