Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers - make old API deprecated (with error where possible) - drop old internal classes related to the old API - refactor usages accordingly - fix and add missing features to the scripting API where necessary
This commit is contained in:
@@ -48,6 +48,7 @@ import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext
|
||||
import org.jetbrains.kotlin.resolve.AnalyzingUtils
|
||||
import java.io.File
|
||||
import kotlin.script.experimental.api.valueOrNull
|
||||
|
||||
class KtCompilingExecutor(file: ScratchFile) : ScratchExecutor(file) {
|
||||
companion object {
|
||||
@@ -186,8 +187,10 @@ class KtCompilingExecutor(file: ScratchFile) : ScratchExecutor(file) {
|
||||
javaParameters.classPath.addAll(JavaParametersBuilder.getModuleDependencies(module))
|
||||
}
|
||||
|
||||
val scriptDependencies = ScriptDependenciesManager.getInstance(originalFile.project).getScriptDependencies(originalFile.virtualFile)
|
||||
javaParameters.classPath.addAll(scriptDependencies.classpath.map { it.absolutePath })
|
||||
ScriptDependenciesManager.getInstance(originalFile.project)
|
||||
.getRefinedCompilationConfiguration(originalFile.virtualFile)?.valueOrNull()?.let {
|
||||
javaParameters.classPath.addAll(it.dependenciesClassPath.map { f -> f.absolutePath })
|
||||
}
|
||||
|
||||
return javaParameters.toCommandLine()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user