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

Handle tasks with no project.

This commit is contained in:
Cedric Beust 2016-06-10 22:19:00 -08:00
parent f8746460be
commit e276f3b6d5

View file

@ -190,13 +190,14 @@ class TaskManager @Inject constructor(val args: Args,
while (toProcess.any()) { while (toProcess.any()) {
toProcess.forEach { ti -> toProcess.forEach { ti ->
val project = projectMap[ti.project] val project = projectMap[ti.project]
val dependents = project!!.projectExtra.dependsOn if (project != null) {
val dependents = project.projectExtra.dependsOn
if (dependents.any()) { if (dependents.any()) {
dependents.forEach { depProject -> dependents.forEach { depProject ->
val tiDep = TaskInfo(depProject.name, ti.taskName) val tiDep = TaskInfo(depProject.name, ti.taskName)
allTaskInfos.add(tiDep) allTaskInfos.add(tiDep)
addEdge(ti, tiDep) addEdge(ti, tiDep)
if (! seen.contains(tiDep)) { if (!seen.contains(tiDep)) {
newTasks.add(tiDep) newTasks.add(tiDep)
seen.add(tiDep) seen.add(tiDep)
} }
@ -206,6 +207,7 @@ class TaskManager @Inject constructor(val args: Args,
addNode(ti) addNode(ti)
} }
} }
}
toProcess.clear() toProcess.clear()
toProcess.addAll(newTasks) toProcess.addAll(newTasks)
newTasks.clear() newTasks.clear()