Implement import test, fix import support in compiler and evaluator
This commit is contained in:
@@ -234,6 +234,9 @@ interface CompiledScript<out ScriptBase : Any> {
|
||||
*/
|
||||
suspend fun getClass(scriptEvaluationConfiguration: ScriptEvaluationConfiguration?): ResultWithDiagnostics<KClass<*>>
|
||||
|
||||
val importedScripts: List<CompiledScript<*>>?
|
||||
get() = null
|
||||
/**
|
||||
* The scripts compiled along with this one in one module, imported or otherwise included into compilation
|
||||
*/
|
||||
val otherScripts: List<CompiledScript<*>>
|
||||
get() = emptyList()
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ fun getMergedScriptText(script: SourceCode, configuration: ScriptCompilationConf
|
||||
/**
|
||||
* The implementation of the SourceCode for a script located in a file
|
||||
*/
|
||||
open class FileScriptSource(val file: File) : ExternalSourceCode {
|
||||
open class FileScriptSource(val file: File, private val preloadedText: String? = null) : ExternalSourceCode {
|
||||
override val externalLocation: URL get() = file.toURI().toURL()
|
||||
override val text: String by lazy { file.readText() }
|
||||
override val text: String by lazy { preloadedText ?: file.readText() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user