kapt: Stop compiler gracefully

This commit is contained in:
Yan Zhulanow
2015-06-09 15:02:17 +03:00
parent fbb8d28120
commit f1b6bd5914
6 changed files with 22 additions and 18 deletions
@@ -152,9 +152,6 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
Disposer.dispose(rootDisposable);
}
}
catch (CompilationInterruptedException e) {
return e.exitCode;
}
catch (Throwable t) {
groupingCollector.report(CompilerMessageSeverity.EXCEPTION, OutputMessageUtil.renderException(t),
CompilerMessageLocation.NO_LOCATION);
@@ -204,12 +201,4 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
return INTERNAL_ERROR;
}
}
public static class CompilationInterruptedException extends RuntimeException {
final ExitCode exitCode;
public CompilationInterruptedException(ExitCode exitCode) {
this.exitCode = exitCode;
}
}
}
@@ -287,6 +287,8 @@ public class KotlinToJVMBytecodeCompiler {
return null;
}
if (!result.getShouldGenerateCode()) return null;
result.throwIfError();
return generate(environment, result, environment.getSourceFiles(), null, null);