exit 1 from kotlin process if compilation failed

This commit is contained in:
Stepan Koltsov
2012-03-02 23:01:47 +04:00
parent cd3b965b3c
commit 4b7c738f29
@@ -140,14 +140,15 @@ public class KotlinCompiler {
environment.setStdlib(arguments.stdlib);
}
boolean ok;
if (arguments.module != null) {
environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
ok = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
}
else {
environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
ok = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
}
return 0;
return ok ? 0 : 1;
}
catch (Throwable t) {
errStream.println(messageRenderer.renderException(t));