title: Gradle task to change a boolean in build config
body: <p>I would like to create a very simple task which change a boolean in my gradle config.</p>
  
  <p>I work on an Android application which can be run with several profiles, and for each build a need to specify if in my code the app must fake the bluetooth or not.</p>
  
  <p>My gradle (relevant code) :</p>
  
  <pre><code>def fakeBluetooth = "true"
  
  buildTypes {
      debug {
          minifyEnabled false
          signingConfig android.signingConfigs.debug
          buildConfigField "boolean", "fakeBluetooth", fakeBluetooth
      }
      release {
          minifyEnabled true
          signingConfig android.signingConfigs.release
          buildConfigField "boolean", "fakeBluetooth", fakeBluetooth
      }
  }
  
  task noFakeBluetooth {
      fakeBluetooth = "false"
  }
  </code></pre>
  
  <p>Example of use in my java code :</p>
  
  <pre><code>if (BuildConfig.fakeBluetooth) {
      processFictiveBluetoothService();
  } else {
      // other case
  }
  </code></pre>
  
  <p>Examples of use in command line : </p>
  
  <pre><code>./gradlew iDebug noFakeBluetooth
  </code></pre>
  
  <p>and </p>
  
  <pre><code>./gradlew iDebug
  </code></pre>
  
  <p>Problem : in both cases the value of fakeBluetooth is always "true" (with or without "noFakeBluetooth" in cmd line).</p>