title: How to access a buildConfigField elsewhere inside a gradle build file
body: <p>I am trying to set a buildConfigField in my productFlavor block, and then reference that field elsewhere in my gradle build file so that I can use this value when constructing the name for my apk.</p>
  
  <p>e.g</p>
  
  <pre><code>productFlavors{
      flavor1{            
          buildConfigField "String", "APP_FLAVOR_NAME", '"MyApp-Flavor1"'
  
      }
      flavor2{            
          buildConfigField "String", "APP_FLAVOR_NAME", '"MyApp-Flavor2"'
  
      }
  </code></pre>
  
  <p>How can I access APP_FLAVOR_NAME elsewhere in my build.gradle script?</p>
  
  <p>I am also struggling to figure out how to just reference the flavor name itself in the buildscript as another option to constructing the apk name. How can I do that as well?</p>