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

com.vk.compiler.plugin.recompose.highlighter.RecomposeHighlighterCommandLineProcessor.kt Maven / Gradle / Ivy

package com.vk.compiler.plugin.recompose.highlighter

import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
import org.jetbrains.kotlin.compiler.plugin.CliOption
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.CompilerConfigurationKey

@OptIn(ExperimentalCompilerApi::class)
class RecomposeHighlighterCommandLineProcessor : CommandLineProcessor {
    override val pluginId: String = "com.vk.recompose-highlighter.compiler-plugin"
    override val pluginOptions: Collection =
        listOf(
            CliOption(
                "enabled",
                "",
                "Is Recompose Highlighter enabled",
                required = false
            )
        )

    override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {
        when (option.optionName) {
            "enabled" -> configuration.put(ENABLED, value.toBoolean())
        }
    }

    companion object {
        val ENABLED = CompilerConfigurationKey("Enable Recompose Highlighter")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy