title: How I can reference a field defined in the gradle script?
body: <p>I have a script to prepare build of an apk.</p>
  
  <p>It defines some value which has some random specific for each build value:</p>
  
  <pre><code>def salt = generateSalt()
  
  def generatedSalt() {
   return generateRandomlySalt
  }
  </code></pre>
  
  <p>In the same script I want to have another method which will operate on this value.</p>
  
  <pre><code>def generateMapAndSalt() {
    // here is additional logic which depends on the defined salt
    generateEncodedHash(certificate, salt, shaKey)
  }
  </code></pre>
  
  <p>There is another method inside of android closure which will pass this defined salt value to the buildConfigFiles.
  How do I reference once generated salt value from defined method?
  Tired accessing it with following syntax:</p>
  
  <pre><code>this.$salt
  $salt
  salt
  </code></pre>
  
  <p>With no luck.</p>