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

dev.mokkery.plugin.core.MokkeryLogApi.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.core

import dev.mokkery.MokkeryConfig
import dev.mokkery.plugin.ir.locationInFile
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.ir.IrElement


internal inline fun TransformerScope.mokkeryErrorAt(element: IrElement, message: () -> String) {
    messageCollector.report(
        severity = CompilerMessageSeverity.ERROR,
        message = message(),
        location = element.locationInFile(currentFile)
    )
}

internal inline fun TransformerScope.mokkeryLogAt(element: IrElement, message: () -> String) {
    messageCollector.report(
        severity = CompilerMessageSeverity.LOGGING,
        message = "${MokkeryConfig.PLUGIN_ID}: ${message()}",
        location = element.locationInFile(currentFile)
    )
}

internal inline fun TransformerScope.mokkeryLog(message: () -> String) {
    messageCollector.report(CompilerMessageSeverity.LOGGING, "${MokkeryConfig.PLUGIN_ID}: ${message()}")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy