title: Gradle buildType/productFlavor using unexpected buildConfigField
body: <p>Given the below configuration:</p>
  
  <pre><code>productFlavors {
    normal {
      applicationId "com.app"
    }
  
    mock {
      applicationId "com.app.mock"
    }
  }
  
  buildTypes {
    debug {
      productFlavors.normal.buildConfigField "boolean", "mockMode", "false"
      productFlavors.mock.buildConfigField "boolean", "mockMode", "true"
    }
  
    release {
      productFlavors.normal.buildConfigField "boolean", "mockMode", "false"
      // Release should never point to mocks. Ever.
      productFlavors.mock.buildConfigField "boolean", "mockMode", "false"
    }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/A9ygO.png" alt="enter image description here"></p>
  
  <p>I would have expected <code>BuildConfig.mockMode = true;</code>, however, this is the resultant build config:</p>
  
  <pre><code>public final class BuildConfig {
    public static final boolean DEBUG = Boolean.parseBoolean("true");
    public static final String APPLICATION_ID = "*****";
    public static final String BUILD_TYPE = "debug";
    public static final String FLAVOR = "mock";
    public static final int VERSION_CODE = 1;
    public static final String VERSION_NAME = "1.0";
    // Fields from product flavor: mock
    public static final boolean mockMode = false;
  }
  </code></pre>
  
  <p>From a little investigation/debugging, I realised that if I change the value for the product flavour in the release buildType it actually updates the <code>BuildConfig.mockMode</code> value, despite having <code>mockDebug</code> selected as my build variant.</p>
  
  <p>I already have a better solution for achieving what I want to do, so I'm just looking for an answer that helps me understand <em>why</em> Gradle is acting in this way based on the configuration, to help me understand more of what it is doing.</p>