Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

What is the Groovy magic for this task command

$
0
0

Sorry, I missed a comma in the no parenthesis examples (edited above).

In the case of a type, you need the comma before the closure. The comma would be optional for some of the other named arguments with different argument types, like dependsOn: 'otherTask'. It just depends on if the syntax is unambiguous to Groovy.

Regardless, just because you can call the task function many different ways, there’s not really a good reason to do so. The convention for an eager task is to write it as (but it’s still the same method call as the other ways):

task hello(type: Copy) {

Viewing all articles
Browse latest Browse all 19888

Trending Articles