title: buildConfigField depending on flavor + buildType
body: <p>I'm trying to define a <em>buildConfigVariable</em> depending on the <em>flavor</em> + <em>buildType</em>. Ideally, this is what I want</p>
  
  <pre><code>productFlavors {
      strawberry {
          buildConfigField "String", "WS_API_KEY", name + variant.buildType.name
      }
      ... more flavors ..
  }
  </code></pre>
  
  <p><em>name</em> does contain "strawberry", but I don't know if it's possible to access the <em>variant</em>'s <em>buildType</em>.</p>
  
  <p>Placed outside the <em>Android</em> closure I do have access to the <em>BuildType</em> and <em>variant</em>, but then I can't invoke <code>buildConfigField</code></p>
  
  <pre><code>android.applicationVariants.all { variant -&gt;
      println "****************************"
      println "variant: ${variant.name}"
      println "flavor: ${variant.flavorName}"
      println "****************************"
  
      if (variant.buildType.name == 'release') {
          if (variant.flavorName == 'strawberry') {
              buildConfigField "String", "WS_API_KEY", '"strawberry_release"'
          } else {
              buildConfigField "String", "WS_API_KEY", '"chocolate_release"'
          }
      } else if(variant.buildType.name == 'debug') {
          if (variant.flavorName == 'strawberry') {
              buildConfigField "String", "WS_API_KEY", '"strawberry_debug"'
          } else {
              buildConfigField "String", "WS_API_KEY", '"chocolate_debug"'
          }
      }
  
  
  ****************************
  variant: strawberryRelease
  flavor: strawberry
  ****************************
  org.gradle.api.internal.MissingMethodException: 
      Could not find method buildConfigField() 
      for arguments [String, WS_API_KEY, "strawberry_release"]
  </code></pre>
  
  <p>I can easily create a Java factory and return the appropriate <code>API_KEY</code> depending on some <code>BuildConfig</code> constants, but I'd rather keep the code configuration agnostic.</p>