title: How to get current buildType in Android Gradle configuration
body: <p>I want to dynamically add a dependency in an Android Gradle project based on the current buildType. I know I can <a href="http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication">specify the buildType in the dependency</a>:</p>
  
  <pre><code>compile project(path: ':lib1', configuration: 'debug')
  </code></pre>
  
  <p>But how can I use the current buildType to specify which variant of the library I want to import, so that a debug or release build automatically imports the debug or release variant of the library? What I want is something like this (where currentBuildType is a variable containing the name of the currently used buildType):</p>
  
  <pre><code>compile project(path: ':lib1', configuration: currentBuildType)
  </code></pre>
  
  <p>The library project I want to import has set <code>publishNonDefault true</code>, so all buildTypes are published.</p>