Run JS DCE gradle task in a separate process

This commit is contained in:
Alexey Andreev
2017-06-06 19:53:42 +03:00
parent cfbb9209a7
commit 479148f7e0
4 changed files with 92 additions and 33 deletions
@@ -147,12 +147,16 @@ abstract class KotlinCompilerRunner<in Env : CompilerEnvironment> {
environment: Env
): ExitCode?
protected fun exitCodeFromProcessExitCode(code: Int): ExitCode {
val exitCode = ExitCode.values().find { it.code == code }
if (exitCode != null) return exitCode
protected fun exitCodeFromProcessExitCode(code: Int): ExitCode = Companion.exitCodeFromProcessExitCode(log, code)
log.debug("Could not find exit code by value: $code")
return if (code == 0) ExitCode.OK else ExitCode.COMPILATION_ERROR
companion object {
fun exitCodeFromProcessExitCode(log: KotlinLogger, code: Int): ExitCode {
val exitCode = ExitCode.values().find { it.code == code }
if (exitCode != null) return exitCode
log.debug("Could not find exit code by value: $code")
return if (code == 0) ExitCode.OK else ExitCode.COMPILATION_ERROR
}
}
}