[minor] Fix potential problems with sequence, add a todo
This commit is contained in:
+3
-3
@@ -154,10 +154,10 @@ private fun CompiledScript<*>.makeClassLoaderFromDependencies(baseClassLoader: C
|
|||||||
(dep as? JvmDependency)?.classpath?.asSequence()?.map { it.toURI().toURL() } ?: emptySequence()
|
(dep as? JvmDependency)?.classpath?.asSequence()?.map { it.toURI().toURL() } ?: emptySequence()
|
||||||
}
|
}
|
||||||
?: emptySequence()
|
?: emptySequence()
|
||||||
}.distinct()
|
}.distinct().toList()
|
||||||
// TODO: previous dependencies and classloaders should be taken into account here
|
// TODO: previous dependencies and classloaders should be taken into account here
|
||||||
return if (dependencies.none()) baseClassLoader
|
return if (dependencies.isEmpty()) baseClassLoader
|
||||||
else URLClassLoader(dependencies.toList().toTypedArray(), baseClassLoader)
|
else URLClassLoader(dependencies.toTypedArray(), baseClassLoader)
|
||||||
}
|
}
|
||||||
|
|
||||||
const val KOTLIN_SCRIPT_METADATA_PATH = "META-INF/kotlin/script"
|
const val KOTLIN_SCRIPT_METADATA_PATH = "META-INF/kotlin/script"
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ internal fun getScriptKtFile(
|
|||||||
val scriptText = getMergedScriptText(script, scriptCompilationConfiguration)
|
val scriptText = getMergedScriptText(script, scriptCompilationConfiguration)
|
||||||
val virtualFile = ScriptLightVirtualFile(
|
val virtualFile = ScriptLightVirtualFile(
|
||||||
script.scriptFileName(script, scriptCompilationConfiguration),
|
script.scriptFileName(script, scriptCompilationConfiguration),
|
||||||
(script as? FileBasedScriptSource)?.file?.path,
|
(script as? FileBasedScriptSource)?.file?.path, // TODO: should be absolute path here
|
||||||
scriptText
|
scriptText
|
||||||
)
|
)
|
||||||
val ktFile = psiFileFactory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, true, false) as KtFile?
|
val ktFile = psiFileFactory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, true, false) as KtFile?
|
||||||
|
|||||||
Reference in New Issue
Block a user