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:
Ilya Chernikov
2019-05-12 22:26:37 +02:00
parent e5054f9648
commit e542c9ea84
94 changed files with 1554 additions and 764 deletions
@@ -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