Remove deprecated usages of CliOption in official compiler plugins

This commit is contained in:
Yan Zhulanow
2018-10-29 09:16:09 +09:00
parent 49941339a3
commit c5e241d5c6
18 changed files with 44 additions and 61 deletions
+3 -6
View File
@@ -18,10 +18,7 @@ package org.jetbrains.kotlin.noarg
import com.intellij.mock.MockProject
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension
import org.jetbrains.kotlin.compiler.plugin.CliOption
import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
import org.jetbrains.kotlin.compiler.plugin.*
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.CompilerConfigurationKey
import org.jetbrains.kotlin.container.StorageComponentContainer
@@ -67,11 +64,11 @@ class NoArgCommandLineProcessor : CommandLineProcessor {
override val pluginId = PLUGIN_ID
override val pluginOptions = listOf(ANNOTATION_OPTION, PRESET_OPTION, INVOKE_INITIALIZERS_OPTION)
override fun processOption(option: CliOption, value: String, configuration: CompilerConfiguration) = when (option) {
override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) = when (option) {
ANNOTATION_OPTION -> configuration.appendList(ANNOTATION, value)
PRESET_OPTION -> configuration.appendList(PRESET, value)
INVOKE_INITIALIZERS_OPTION -> configuration.put(INVOKE_INITIALIZERS, value == "true")
else -> throw CliOptionProcessingException("Unknown option: ${option.name}")
else -> throw CliOptionProcessingException("Unknown option: ${option.optionName}")
}
}