title: Difference between Extensions and Extra properties in Gradle
body: <p>According to <a href="https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtensionAware.html" rel="nofollow noreferrer">Gradle docs</a>, the <code>ExtensionAware</code> objects can be extended at runtime with other objects. </p>
  
  <p>So we can create </p>
  
  <pre><code>// Add new extensions via the extension container
  project.extensions.create('custom', String, "bar")
  </code></pre>
  
  <p>and then can access it as</p>
  
  <pre><code>project.custom == "bar"
  </code></pre>
  
  <p>Then, we have <a href="https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html" rel="nofollow noreferrer">Extra properties extensions</a> that allow new properties to be added to existing objects.</p>
  
  <pre><code>project.ext.custom = "bar"
  </code></pre>
  
  <p>or simply</p>
  
  <pre><code>project.custom = "bar"
  </code></pre>
  
  <p>It seems there is no difference between the two from the usability point of view.</p>
  
  <p>I understand <code>ext</code> is a special extension and the scope for searching properties is different from other extensions, but what is a practical difference between the two? Do simple extensions and ext provide the same functionality?</p>