title: Android Gradle: library jar flavors?
body: <p>I need to build an Android library as a JAR (as well as an AAR), but also with flavors. The flavors happen to be based on the source compatibility.</p>
  
  <p>I have this,</p>
  
  <pre><code>android.productFlavors {
    java6 {
      // yes, other stuff here
    }
    java7 {
      // and here
    }
  }
  ...
  task jar(type: Jar) {
      from android.sourceSets.main.java.srcDirs
  }
  </code></pre>
  
  <p>But I only get one .jar in <code>build/libs</code>. I see the build output,</p>
  
  <pre><code>:common-taskqueue:jarJava6Debug
  :common-taskqueue:jarJava7Debug
  ...
  </code></pre>
  
  <p>So it seems like it's doing the work, but possibly writing each JAR to the same output file for each flavor?</p>