1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Better error reporting when launching separate kotlinc.

This commit is contained in:
Cedric Beust 2017-02-08 14:10:59 -08:00
parent 138ba15f3a
commit 224a5d7925
2 changed files with 6 additions and 2 deletions

View file

@ -37,6 +37,8 @@ class RunCommandInfo {
! hasErrors
}
var containsErrors: ((List<String>) -> Boolean)? = null
}
fun runCommand(init: RunCommandInfo.() -> Unit) = NewRunCommand(RunCommandInfo().apply { init() }).invoke()
@ -84,7 +86,9 @@ open class NewRunCommand(val info: RunCommandInfo) {
else listOf()
// Check to see if the command succeeded
val isSuccess = isSuccess(returnCode, input, error)
val isSuccess =
if (info.containsErrors != null) ! info.containsErrors!!(error)
else isSuccess(returnCode, input, error)
if (isSuccess) {
info.successCallback(input)