Implement context classpath extraction using particular class,...

Use it in the main-kts.
Also improve diagnoistics related to the definition loading.

#KT-26828 fixed (after this commit - finally, see also another related commit)
This commit is contained in:
Ilya Chernikov
2018-09-14 17:08:29 +02:00
parent d9760f00f6
commit d760299dc1
3 changed files with 10 additions and 3 deletions
@@ -60,7 +60,7 @@ fun createCompilationConfigurationFromTemplate(
fun scriptConfigInstance(kclass: KClass<out ScriptCompilationConfiguration>): ScriptCompilationConfiguration = try {
kclass.objectInstance ?: kclass.createInstance()
} catch (e: Throwable) {
throw IllegalArgumentException(ILLEGAL_CONFIG_ANN_ARG, e)
throw IllegalArgumentException("$ILLEGAL_CONFIG_ANN_ARG: ${e.message}", e)
}
return ScriptCompilationConfiguration(scriptConfigInstance(mainAnnotation.compilationConfiguration)) {