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:
@@ -41,10 +41,14 @@ fun getMergedScriptText(script: SourceCode, configuration: ScriptCompilationConf
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FileBasedScriptSource() : ExternalSourceCode {
|
||||
abstract val file: File
|
||||
}
|
||||
|
||||
/**
|
||||
* The implementation of the SourceCode for a script located in a file
|
||||
*/
|
||||
open class FileScriptSource(val file: File, private val preloadedText: String? = null) : ExternalSourceCode {
|
||||
open class FileScriptSource(override val file: File, private val preloadedText: String? = null) : FileBasedScriptSource() {
|
||||
override val externalLocation: URL get() = file.toURI().toURL()
|
||||
override val text: String by lazy { preloadedText ?: file.readText() }
|
||||
override val name: String? get() = file.name
|
||||
|
||||
Reference in New Issue
Block a user