[minor] Drop some usages of kotlin reflection in scripting compiler plugin
This commit is contained in:
@@ -22,6 +22,8 @@ dependencies {
|
||||
// FIXME: drop after removing references to LocalFileSystem they don't exist in intellij-core
|
||||
compileOnly(intellijDep()) { includeJars("platform-api") }
|
||||
|
||||
runtime(project(":kotlin-reflect"))
|
||||
|
||||
testCompile(project(":compiler:frontend"))
|
||||
testCompile(project(":compiler:plugin-api"))
|
||||
testCompile(project(":compiler:util"))
|
||||
|
||||
+2
-2
@@ -71,7 +71,7 @@ class LazyScriptDefinitionFromDiscoveredClass internal constructor(
|
||||
override val evaluationConfiguration: ScriptEvaluationConfiguration get() = configurations.second
|
||||
|
||||
override val fileExtension: String by lazy(LazyThreadSafetyMode.PUBLICATION) {
|
||||
annotationsFromAsm.find { it.name == KotlinScript::class.simpleName }?.args
|
||||
annotationsFromAsm.find { it.name == KotlinScript::class.java.simpleName }?.args
|
||||
?.find { it.name == "fileExtension" }?.value
|
||||
?: compilationConfiguration.let {
|
||||
it[ScriptCompilationConfiguration.fileExtension] ?: super.fileExtension
|
||||
@@ -79,7 +79,7 @@ class LazyScriptDefinitionFromDiscoveredClass internal constructor(
|
||||
}
|
||||
|
||||
override val name: String by lazy(LazyThreadSafetyMode.PUBLICATION) {
|
||||
annotationsFromAsm.find { it.name == KotlinScript::class.simpleName!! }?.args?.find { it.name == "name" }?.value
|
||||
annotationsFromAsm.find { it.name == KotlinScript::class.java.simpleName!! }?.args?.find { it.name == "name" }?.value
|
||||
?: super.name
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -289,7 +289,7 @@ private fun loadScriptDefinition(
|
||||
val anns = loadAnnotationsFromClass(templateClassBytes)
|
||||
for (ann in anns) {
|
||||
var def: ScriptDefinition? = null
|
||||
if (ann.name == KotlinScript::class.simpleName) {
|
||||
if (ann.name == KotlinScript::class.java.simpleName) {
|
||||
def = LazyScriptDefinitionFromDiscoveredClass(
|
||||
hostConfiguration,
|
||||
anns,
|
||||
@@ -297,7 +297,7 @@ private fun loadScriptDefinition(
|
||||
classpathWithLoader.classpath,
|
||||
messageReporter
|
||||
)
|
||||
} else if (ann.name == ScriptTemplateDefinition::class.simpleName) {
|
||||
} else if (ann.name == ScriptTemplateDefinition::class.java.simpleName) {
|
||||
val templateClass = classpathWithLoader.classLoader.loadClass(templateClassName).kotlin
|
||||
def = ScriptDefinition.FromLegacy(
|
||||
hostConfiguration,
|
||||
|
||||
Reference in New Issue
Block a user