kotlinx.rpc.codegen.extension.RPCIrExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-rpc-compiler-plugin-backend Show documentation
Show all versions of kotlinx-rpc-compiler-plugin-backend Show documentation
kotlinx.rpc, a Kotlin library for adding asynchronous RPC services to your applications.
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.rpc.codegen.extension
import kotlinx.rpc.codegen.VersionSpecificApi
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
class RPCIrExtension(configuration: CompilerConfiguration) : IrGenerationExtension {
private val logger = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
override fun generate(
moduleFragment: IrModuleFragment,
pluginContext: IrPluginContext,
) {
val context = RPCIrContext(pluginContext, VersionSpecificApi.INSTANCE)
val processor = RPCIrServiceProcessor(logger)
moduleFragment.transform(processor, context)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy