title: Property not found in gradle subproject
body: <p>I have a simple gradle project that has the following structure:</p>
  
  <pre><code>root
  |
  sampleapp
  |  |
  |  build.gradle
  |
  build.gradle
  settings.gradle
  gradle.properties
  </code></pre>
  
  <p>In my root <code>build.gradle</code> I have the following closures:</p>
  
  <pre><code>subprojects {
     ext {
       flag = true
     }
     afterEvaluate { subproj -&gt; 
       if(subproj.ext.flag) {
          sampleProp = [
               prop1: "abc",
               prop2: "def"
          ]
       }
     }
  }
  </code></pre>
  
  <p>When I run my gradle build, the 'sampleapp' project uses the sampleProp structure, but I get the following exception:</p>
  
  <pre><code>Could not find property 'sampleProp' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@7d548fa0.
  </code></pre>
  
  <p>Anything obvious what I am doing wrong?</p>