why can quotes be left out in names of gradle tasks
问题 I don't understand why we don't need to add quotes to the name of gradle task when we declare it like: task hello (type : DefaultTask) { } I've tried in a groovy project and found that it's illegal, how gradle makes it works. And I don't understand the expression above neither, why we can add (type : DefaultTask) , how can we analyze it with groovy grammar? 回答1: As an example in a GroovyConsole runnable form, you can define a bit of code thusly: // Set the base class for our DSL @BaseScript