title: What is the named struct in gradle?
body: <p>Look at the codes: <a href="https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html" rel="nofollow noreferrer">https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html</a></p>
  <pre><code>publishing {
    publications {
      myPublicationName(MavenPublication) {
        // Configure the publication here
      }
    }
  }
  </code></pre>
  <p>There are two script blocks: <code>publishing</code>, <code>publications</code>. Gradle is based on <code>groovy</code> so I guess block script is a type of method like:</p>
  <pre><code>def publishing(Closure closure)
  </code></pre>
  <p>But, what is the <code>myPublicationName(MavenPublication)</code>?  <code>myPublicationName</code> is a random name (there is no possible a method named <code>myPublicationName</code>, its dynamic not prepared), and MavenPublication is a type.</p>