title: How to list all flavors in buildConfig via gradle in Android
body: <p>This is a simple gradle with three flavors :</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.2"
  
      defaultConfig {
          applicationId "com.apipas.app.listallflavor"
          minSdkVersion 14
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      productFlavors {
  
          au {
              applicationId 'com.apipas.app.listallflavor.au'
              resConfigs 'en-rAU'
          }
          es {
              applicationId 'com.apipas.app.listallflavor.es'
              resConfigs 'es'
          }
  
          de {
              applicationId 'com.apipas.app.listallflavor.de'
              resConfigs 'de'
          }
  
      }
      productFlavors.all {
          flavor -&gt;
              println( flavor.name)
              buildConfigField 'String', 'var_'+flavor.name, '\"'+flavor.name+'\"'
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.1.1'
  }
  </code></pre>
  
  <p>BuildConfig.java is:</p>
  
  <pre><code>/**
   * Automatically generated file. DO NOT MODIFY
   */
  package com.apipas.app.listallflavor;
  
  public final class BuildConfig {
    public static final boolean DEBUG = Boolean.parseBoolean("true");
    public static final String APPLICATION_ID = "com.apipas.app.listallflavor.au";
    public static final String BUILD_TYPE = "debug";
    public static final String FLAVOR = "au";
    public static final int VERSION_CODE = 1;
    public static final String VERSION_NAME = "1.0";
    // Fields from product flavor: au
    public static final String var_au = "au";
  }
  </code></pre>
  
  <p>What I expected :</p>
  
  <pre><code>/**
   * Automatically generated file. DO NOT MODIFY
   */
  package com.apipas.app.listallflavor;
  
  public final class BuildConfig {
    public static final boolean DEBUG = Boolean.parseBoolean("true");
    public static final String APPLICATION_ID = "com.apipas.app.listallflavor.au";
    public static final String BUILD_TYPE = "debug";
    public static final String FLAVOR = "au";
    public static final int VERSION_CODE = 1;
    public static final String VERSION_NAME = "1.0";
    // Fields from product flavor: au
    public static final String var_au = "au";
    public static final String var_de = "de";
    public static final String var_es = "es";
  }
  </code></pre>
  
  <p>Weird thing that I can see all flavors in logs:
  au
  de
  es</p>
  
  <p>but I don't have fields in buildConfig for 'de' and 'es' as I expected .. any hint, guys ?</p>