title: What is the difference between these task definition syntaxes in gradle?
body: <p>A)  </p>
  
  <pre><code>task build &lt;&lt; {  
    description = "Build task."  
    ant.echo('build')  
  }
  </code></pre>
  
  <p>B)  </p>
  
  <pre><code>task build {  
    description = "Build task."  
    ant.echo('build')  
  }
  </code></pre>
  
  <p>I notice that with type B, the code within the task seems to be executed when typing <code>gradle -t</code> - ant echoes out 'build' even when just listing all the various available tasks. The description is also actually displayed with type B. However, with type A no code is executed when listing out the available tasks, and the description is not displayed when executing <code>gradle -t</code>. The docs don't seem to go into the difference between these two syntaxes (that I've found), only that you can define a task either way.</p>