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

kotlinx.rpc.codegen.RPCCompilerPlugin.kt Maven / Gradle / Ivy

There is a newer version: 1.9.24-0.2.2
Show newest version
/*
 * 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

import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.compiler.plugin.CliOption
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration

@OptIn(ExperimentalCompilerApi::class)
class RPCCommandLineProcessor : CommandLineProcessor {
    override val pluginId = "kotlinx.rpc.compiler-plugin"

    override val pluginOptions = emptyList()
}

@OptIn(ExperimentalCompilerApi::class)
class RPCCompilerPlugin : CompilerPluginRegistrar() {
    init {
        VersionSpecificApi.INSTANCE = VersionSpecificApiImpl
    }

    override val supportsK2: Boolean = false

    override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
        val extension = RPCCompilerPluginCore.provideExtension(configuration)

        IrGenerationExtension.registerExtension(extension)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy