title: Gradle build.gradle code style
body: <p><strong>Is there code style for Gradle <code>build.gradle</code> files?</strong></p>
  
  <p>Of course for groovy pieces Groovy rules could apply,<br>
  but for Gradle DSL is there any conventions?</p>
  
  <p>Like <a href="http://www.nodeclipse.org/projects/gradle/style" rel="nofollow">putting plugin configuration right after <code>apply</code></a></p>
  
  <pre><code>apply plugin: 'application'
  mainClassName = "com.example.MainClass"
  </code></pre>
  
  <p>For Maven I usually used <a href="http://maven.apache.org/pom.html#Quick_Overview" rel="nofollow">POM Reference</a>, but putting <code>&lt;!-- Build Settings --&gt;</code> as the last section.</p>
  
  <p>As <code>build.gradle</code> can grow quite long for some project, it would be nice to have standard structure for references.</p>