How does Gradle generate a new task from a task rules
问题 In section 19.11. of the 4.2.1 user guide is this task rule example. How is the if predicate able to be true before the rule is even executed. I also noticed that when task groupPing is entered before the task rule the build fails. How are the tasks pingServer1, pingServer2 already created before the rule even starts? tasks.addRule("Pattern: ping<ID>") { String taskName -> if (taskName.startsWith("ping")) { task(taskName) { doLast { println "Pinging: " + (taskName - 'ping') } } } } task