mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-25 16:07:12 -07:00
Task order fix.
This commit is contained in:
parent
87c4dead2c
commit
4e3d727da6
3 changed files with 6 additions and 10 deletions
|
@ -150,14 +150,10 @@ abstract class BaseProjectRunner {
|
|||
//
|
||||
passedTasks.map { it.taskName }.let { taskNames ->
|
||||
runBefore[taskName].forEach { from ->
|
||||
if (taskNames.contains(from)) {
|
||||
addEdge(result, from, taskName, newToProcess, "runBefore")
|
||||
}
|
||||
addEdge(result, from, taskName, newToProcess, "runBefore")
|
||||
}
|
||||
runAfter[taskName].forEach { to ->
|
||||
if (taskNames.contains(to)) {
|
||||
addEdge(result, taskName, to, newToProcess, "runAfter")
|
||||
}
|
||||
addEdge(result, to, taskName, newToProcess, "runAfter")
|
||||
}
|
||||
}
|
||||
seen.add(taskName)
|
||||
|
|
|
@ -46,7 +46,7 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
/**
|
||||
* Ordering: task2 runs after task 1.
|
||||
*/
|
||||
fun runAfter(task1: String, task2: String) = runAfter.put(task2, task1)
|
||||
fun runAfter(task1: String, task2: String) = runAfter.put(task1, task2)
|
||||
|
||||
/**
|
||||
* Wrapper task: task2 runs after task 1.
|
||||
|
|
|
@ -126,7 +126,7 @@ class TaskManagerTest : BaseTest() {
|
|||
put("compile", "clean")
|
||||
},
|
||||
runAfter = TreeMultimap.create<String, String>().apply {
|
||||
put("compile", "example")
|
||||
put("example", "compile")
|
||||
}).let { runTasks ->
|
||||
assertThat(runTasks).isEqualTo(listOf("clean", "compile"))
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ class TaskManagerTest : BaseTest() {
|
|||
runBefore = TreeMultimap.create<String, String>().apply {
|
||||
put("compile", "example")
|
||||
}).let { runTasks ->
|
||||
assertThat(runTasks).isEqualTo(listOf("clean", "compile"))
|
||||
assertThat(runTasks).isEqualTo(listOf("clean", "compile", "example"))
|
||||
}
|
||||
|
||||
runTasks(listOf("compile", "example"),
|
||||
|
@ -158,7 +158,7 @@ class TaskManagerTest : BaseTest() {
|
|||
runAfter = TreeMultimap.create<String, String>().apply {
|
||||
put("compile", "example")
|
||||
}).let { runTasks ->
|
||||
assertThat(runTasks).isEqualTo(listOf("clean", "example", "compile"))
|
||||
assertThat(runTasks).isEqualTo(listOf("clean", "compile", "example"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue