Slackbot
01/04/2024, 11:03 PMVinay Potluri
01/04/2024, 11:03 PMproject
.tasks
.forEach {
println("Task : ${it.name}"}
}Vinay Potluri
01/04/2024, 11:05 PMproject.afterEvaluate {
project.tasks.all {
println("Task : ${it.name}"}
}
}
The results are still the sameOctavia Togami
01/05/2024, 1:35 AMafterEvaluate , and tasks that aren't realized (i.e. created lazily with register and not depended upon by the task graph) will never run your configureEach block. However, if you only need the configuration to apply when a task is being used, the first thing you did is correct.Vinay Potluri
01/05/2024, 1:45 AMgetByName or findByName and then configure it with finalizedBy ?
Something like:
project
.tasks
.getByName("customTask")
.configure {
it.finalizedBy(anotherTask)
}
And hope that anotherTask will get picked after customTask is executed ?Vampire
01/05/2024, 4:17 AMnamed. Like taks.named("customTask") { finalizedBy(anotherTask) }.
If customTask could be registered later, use matching like tasks.matching { it.name == "customTask" }.configureEach { finalizedBy(anotherTask) }.