title: Gradle initscript block properties
body: <p>Is there a way to reuse external properties in custom <code>initscript</code> block inside <code>init.gradle?</code></p>
  
  <pre><code>def REPO_URL = 'myRepoUrl'
  
  initscript {
      repositories {
          maven {
              url REPO_URL
          }
      }
      dependencies {
          classpath 'some dependency'
      }
  }
  </code></pre>
  
  <p>This gives me unknown property error. I have also tried using ext{} like so</p>
  
  <pre><code>ext {
      REPO_URL = 'myRepoUrl'
  }
  </code></pre>
  
  <p>with the same error. Yet it works in all other configuration blocks I tried so far even inside <code>init.gradle</code>. This forces me to duplicate properties for <code>initscript</code> block and rest of the configuration.</p>
  
  <p>After a bit more examination it looks like it totally looses any reference to surrounding scope. I don´t even understand why does it behave this way from Groovy standpoint.</p>