Implement invokable/invoker interface on the generic repl evaluator, refactor reflection utils on the way

This commit is contained in:
Ilya Chernikov
2016-11-30 12:37:34 +01:00
parent 7a79fff9d6
commit fbd4c6eb61
8 changed files with 205 additions and 79 deletions
@@ -202,7 +202,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
try {
Class<?> klass = classLoader.loadClass(nameForScript.asString());
ExecuteKotlinScriptMojo.INSTANCE = this;
if (ReflectionUtilKt.tryConstructScriptClass(klass, scriptArguments) == null)
if (ReflectionUtilKt.tryConstructClassFromStringArgs(klass, scriptArguments) == null)
throw new ScriptExecutionException(scriptFile, "unable to construct script");
} catch (ClassNotFoundException e) {
throw new ScriptExecutionException(scriptFile, "internal error", e);