title: Gradle: Only resolve dependencies for the desired variant
body: <p>I have a test app with three flavors:</p>
  
  <ul>
  <li>dev: Uses a local copy of the library during development</li>
  <li>qa: Uses a snapshot during QA</li>
  <li>rc: Uses a prerelease build for release candidate testing.</li>
  </ul>
  
  <hr>
  
  <pre><code>dependencies {
    devCompile project(':library')
    qaCompile 'com.example:library:1.0.0-SNAPSHOT@aar'
    rcCompile 'com.example:library:1.0.0@aar'
  }
  </code></pre>
  
  <p>I run Gradle, and expect it to do the minimum amount of work necessary to build just what I want:</p>
  
  <pre><code>./gradlew :test-app:connectedAndroidTestDevDebug
  </code></pre>
  
  <p>However, the build fails, because it is trying to resolve dependencies for all build flavors, not just the one I am building.</p>
  
  <blockquote>
    <p>FAILURE: Build failed with an exception.</p>
    
    <p>* What went wrong:</p>
    
    <p>A problem occurred configuring project ':test-app'.</p>
    
    <p>Could not resolve all dependencies for configuration ':test-app:_qaDebugCompile'.</p>
    
    <p>Could not find com.example:library1.0.0-SNAPSHOT.</p>
  
  <pre><code>Searched in the following locations:
       https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml
       https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom
       https://repo1.maven.org/maven2/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar
       http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml
       http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom
       http://oss.sonatype.org/content/repositories/snapshots/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar
       file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml
       file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom
       file:/opt/android-sdk-macosx/extras/android/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar
       file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/maven-metadata.xml
       file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.pom
       file:/opt/android-sdk-macosx/extras/google/m2repository/com/example/library/1.0.0-SNAPSHOT/library-1.0.0-SNAPSHOT.aar
   Required by:
       project-name:test-app:unspecified
  </code></pre>
  </blockquote>
  
  <p>The SNAPSHOT that the <code>qa</code> flavor is trying to resolve doesn't exist yet, and that should be fine, because I'm not trying to build the <code>qa</code> flavor. If that SNAPSHOT build is present, then everything works fine.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why are all build flavors having their dependencies resolved?</li>
  <li>How can I accomplish building just one flavor without encountering this problem?</li>
  <li>Is there some better way to do this that will be more "Gradley"?</li>
  </ol>