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

Don't blow up if logLevel == 1.

This commit is contained in:
Cedric Beust 2016-02-06 01:37:25 +04:00
parent ed43660d50
commit f6927e2304

View file

@ -2,10 +2,8 @@ package com.beust.kobalt.internal
import com.beust.kobalt.KobaltException import com.beust.kobalt.KobaltException
import com.beust.kobalt.TaskResult import com.beust.kobalt.TaskResult
import com.beust.kobalt.misc.NamedThreadFactory import com.beust.kobalt.api.Kobalt
import com.beust.kobalt.misc.error import com.beust.kobalt.misc.*
import com.beust.kobalt.misc.log
import com.beust.kobalt.misc.toString
import com.google.common.collect.HashMultimap import com.google.common.collect.HashMultimap
import java.lang.reflect.InvocationTargetException import java.lang.reflect.InvocationTargetException
import java.util.concurrent.* import java.util.concurrent.*
@ -94,8 +92,12 @@ public class DynamicGraphExecutor<T>(val graph: DynamicGraph<T>,
} }
executor.shutdown() executor.shutdown()
if (graph.freeNodes.size == 0 && graph.nodesReady.size > 0) { if (graph.freeNodes.size == 0 && graph.nodesReady.size > 0) {
throw KobaltException("Couldn't find any free nodes but a few nodes still haven't run, there is " + if (KobaltLogger.LOG_LEVEL > 1) {
"a cycle in the dependencies.\n Nodes left: " + graph.dump(graph.nodesReady)) throw KobaltException("Couldn't find any free nodes but a few nodes still haven't run, there is " +
"a cycle in the dependencies.\n Nodes left: " + graph.dump(graph.nodesReady))
} else {
error("Error during the build")
}
} }
return if (lastResult.success) 0 else 1 return if (lastResult.success) 0 else 1
} }