[minor] Drop some usages of kotlin reflection in scripting compiler plugin
This commit is contained in:
@@ -16,7 +16,6 @@ dependencies {
|
||||
compile(project(":kotlin-scripting-jvm"))
|
||||
compile(project(":kotlin-scripting-compiler-impl"))
|
||||
compile(kotlinStdlib())
|
||||
compileOnly(project(":kotlin-reflect-api"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
testCompile(project(":compiler:frontend"))
|
||||
|
||||
+3
-2
@@ -6,13 +6,14 @@
|
||||
package org.jetbrains.kotlin.scripting.compiler.plugin.impl
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.arguments.Argument
|
||||
import org.jetbrains.kotlin.cli.common.arguments.ArgumentParseErrors
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.kotlin.scripting.definitions.MessageReporter
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
import kotlin.reflect.full.findAnnotation
|
||||
import kotlin.script.experimental.api.ResultWithDiagnostics
|
||||
import kotlin.script.experimental.api.ScriptDiagnostic
|
||||
import kotlin.script.experimental.api.SourceCode
|
||||
@@ -136,7 +137,7 @@ private fun reportIgnoredArguments(
|
||||
) {
|
||||
val ignoredArgKeys = toIgnore.mapNotNull { argProperty ->
|
||||
if (argProperty.get(arguments) != argProperty.get(reportingState.currentArguments)) {
|
||||
argProperty.findAnnotation<Argument>()?.value
|
||||
argProperty.annotations.firstIsInstanceOrNull<Argument>()?.value
|
||||
?: throw IllegalStateException("unknown compiler argument property: $argProperty: no Argument annotation found")
|
||||
} else null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user