All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mokkery.plugin.MokkeryCompilerPluginRegistrar.kt Maven / Gradle / Ivy

Go to download

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))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy