dev.mokkery.plugin.MokkeryIrGenerationExtension.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 dev.mokkery.plugin.core.CompilerPluginScope
import dev.mokkery.plugin.transformers.MokkeryTransformer
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
class MokkeryIrGenerationExtension(
private val config: CompilerConfiguration,
) : IrGenerationExtension {
override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
MokkeryTransformer(CompilerPluginScope(config, pluginContext))
.visitModuleFragment(moduleFragment)
}
}