Slackbot
12/14/2023, 9:51 AMVampire
12/14/2023, 10:18 AMtasks.taskB {
tasks.taskA {
taskAProperty = "A"
}
}
where taskA
is only configured if taskB
is configured. So if you execute taskA
without taskB
it is configured differently.
Also the whole configuration phase including init script, settings scripts, and so on is all skipped and the task state restored from cache and immediately executed.
So a CC entry as a whole can only be reused for the same set of tasks that is going to be executed.A Abhishek
12/14/2023, 12:39 PMtaskAProperty
will get configured irrespective of whether taskB
gets executed or not , especially because setting taskAProperty is not inside taskB's action.
Maybe my understanding of configuration phase is flawed .Vampire
12/14/2023, 2:03 PMtasks.all { ... }
or dependsOn(tasks.matching { it.name == "abc" })
or some other things, but that could be considered a build bug.
And configuring any task (does not matter whether itself or another task) from the execution phase of a task is bad practice and with configuration cache enabled also not allowed.
With configuration cache all tasks that do not depend on each other are allowed to run in parallel which additionally speeds up the build besides skipping the configuration phase and if one task would be allowed to configure any other one would break this.A Abhishek
12/14/2023, 2:04 PM