Daemon: do not exit with internal error on invalid arguments

Invalid compiler arguments should lead to a compilation error, not
internal error. This has been fixed by splitting the
"parseArguments(...)" call (which does parsing + validation) in
CompileServiceImpl into two calls of parseCommandLineArguments +
validateArguments, and returning with a compilation error if the latter
did not succeed

 #KT-16057 Fixed
 #KT-14848 In Progress
This commit is contained in:
Alexander Udalov
2017-04-21 13:51:41 +03:00
parent 2cad64881d
commit a67382fdec
5 changed files with 23 additions and 67 deletions
@@ -106,7 +106,7 @@ abstract class CLITool<A : CommonToolArguments> {
}
}
protected abstract fun createArguments(): A
abstract fun createArguments(): A
// Used in kotlin-maven-plugin (KotlinCompileMojoBase) and in kotlin-gradle-plugin (KotlinJvmOptionsImpl, KotlinJsOptionsImpl)
fun parseArguments(args: Array<out String>, arguments: A) {
@@ -82,7 +82,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@NotNull
@Override
protected K2JSCompilerArguments createArguments() {
public K2JSCompilerArguments createArguments() {
return new K2JSCompilerArguments();
}