Implement base zip cache with tests...
plus some relevant fixes and refactorings
This commit is contained in:
+2
@@ -81,6 +81,8 @@ private fun ScriptCompilationConfiguration.Builder.propertiesFromTemplate(
|
||||
private val KClass<*>.kotlinScriptAnnotation: KotlinScript
|
||||
get() = findAnnotation()
|
||||
?: when (this@kotlinScriptAnnotation.qualifiedName) {
|
||||
// Any is the default template, so use a default annotation
|
||||
Any::class.qualifiedName,
|
||||
// transitions to the new scripting API: substituting annotations for standard templates from script-runtime
|
||||
"$SCRIPT_RUNTIME_TEMPLATES_PACKAGE.SimpleScriptTemplate",
|
||||
"$SCRIPT_RUNTIME_TEMPLATES_PACKAGE.ScriptTemplateWithArgs",
|
||||
|
||||
@@ -31,6 +31,17 @@ class ScriptingHostConfiguration(baseScriptingConfigurations: Iterable<Scripting
|
||||
companion object : ScriptingHostConfigurationKeys
|
||||
}
|
||||
|
||||
/**
|
||||
* An alternative to the constructor with base configuration, which returns a new configuration only if [body] adds anything
|
||||
* to the original one, otherwise returns original
|
||||
*/
|
||||
fun ScriptingHostConfiguration?.with(body: ScriptingHostConfiguration.Builder.() -> Unit): ScriptingHostConfiguration {
|
||||
val newConfiguration =
|
||||
if (this == null) ScriptingHostConfiguration(body = body)
|
||||
else ScriptingHostConfiguration(this, body = body)
|
||||
return if (newConfiguration != this) newConfiguration else this
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of all dependencies required for the script base class and refinement callbacks
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user