main.io.mths.kava.compiler.KavaCommandLineProcessor.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kava-compiler-plugin Show documentation
Show all versions of kava-compiler-plugin Show documentation
Kotlin Compiler Plugin to simplify development with kava.
The newest version!
package io.mths.kava.compiler
import com.google.auto.service.AutoService
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.config.CompilerConfiguration
import org.jetbrains.kotlin.config.CompilerConfigurationKey
val KEY_ENABLED = CompilerConfigurationKey("whether Kava is enabled")
@AutoService(CommandLineProcessor::class)
class KavaCommandLineProcessor : CommandLineProcessor {
override val pluginId: String = "kavaPlugin"
override val pluginOptions: Collection = listOf(
CliOption(
optionName = "enabled",
valueDescription = "",
description = "whether to enable Kava or not",
required = true
)
)
override fun processOption(
option: AbstractCliOption,
value: String,
configuration: CompilerConfiguration
) = when (option.optionName) {
"enabled" -> configuration.put(KEY_ENABLED, value.toBoolean())
else -> configuration.put(KEY_ENABLED, true)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy