com.bennyhuo.kotlin.trimindent.compiler.TrimIndentCompilerPluginRegistrar.kt Maven / Gradle / Ivy
package com.bennyhuo.kotlin.trimindent.compiler
import com.google.auto.service.AutoService
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
lateinit var logger: Logger
@OptIn(ExperimentalCompilerApi::class)
@AutoService(CompilerPluginRegistrar::class)
class TrimIndentCompilerPluginRegistrar : CompilerPluginRegistrar() {
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
logger = Logger(configuration.get(CLIConfigurationKeys.ORIGINAL_MESSAGE_COLLECTOR_KEY)!!)
IrGenerationExtension.registerExtension(TrimIndentIrGenerator())
}
override val supportsK2: Boolean
get() = true
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy