Compiler output stream fixed
Exit code 1 not reported in the IDE
This commit is contained in:
@@ -147,15 +147,15 @@ public class KotlinCompiler {
|
|||||||
environment.addToClasspath(arguments.classpath);
|
environment.addToClasspath(arguments.classpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean ok;
|
boolean noErrors;
|
||||||
if (arguments.module != null) {
|
if (arguments.module != null) {
|
||||||
ok = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
noErrors = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ok = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
noErrors = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok ? 0 : 1;
|
return noErrors ? 0 : 1;
|
||||||
}
|
}
|
||||||
catch (Throwable t) {
|
catch (Throwable t) {
|
||||||
errStream.println(messageRenderer.renderException(t));
|
errStream.println(messageRenderer.renderException(t));
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ public class CompileEnvironment {
|
|||||||
final String directory = new File(moduleScriptFile).getParent();
|
final String directory = new File(moduleScriptFile).getParent();
|
||||||
for (Module moduleBuilder : modules) {
|
for (Module moduleBuilder : modules) {
|
||||||
CompileEnvironment compileEnvironment = new CompileEnvironment(myFileNameTransformer, myMessageRenderer);
|
CompileEnvironment compileEnvironment = new CompileEnvironment(myFileNameTransformer, myMessageRenderer);
|
||||||
|
compileEnvironment.setIgnoreErrors(ignoreErrors);
|
||||||
|
compileEnvironment.setErrorStream(myErrorStream);
|
||||||
// copy across any compiler plugins
|
// copy across any compiler plugins
|
||||||
compileEnvironment.getMyEnvironment().getCompilerPlugins().addAll(myEnvironment.getCompilerPlugins());
|
compileEnvironment.getMyEnvironment().getCompilerPlugins().addAll(myEnvironment.getCompilerPlugins());
|
||||||
ClassFileFactory moduleFactory = compileEnvironment.compileModule(moduleBuilder, directory);
|
ClassFileFactory moduleFactory = compileEnvironment.compileModule(moduleBuilder, directory);
|
||||||
|
|||||||
@@ -517,8 +517,10 @@ public class JetCompiler implements TranslatingCompiler {
|
|||||||
if (firstUnprocessedIndex < output.length()) {
|
if (firstUnprocessedIndex < output.length()) {
|
||||||
handleSkippedOutput(output.substring(firstUnprocessedIndex).trim());
|
handleSkippedOutput(output.substring(firstUnprocessedIndex).trim());
|
||||||
}
|
}
|
||||||
if (event.getExitCode() != 0) {
|
int exitCode = event.getExitCode();
|
||||||
compileContext.addMessage(ERROR, "Compiler terminated with exit code: " + event.getExitCode(), "", -1, -1);
|
// 0 is normal, 1 is "errors found" — handled by the messages above
|
||||||
|
if (exitCode != 0 && exitCode != 1) {
|
||||||
|
compileContext.addMessage(ERROR, "Compiler terminated with exit code: " + exitCode, "", -1, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user