title: Android Studio multiple compileSdkVersion options
body: <p>Android Studio 1.1.0. We are building an Android app that is to target multiple hardware devices that will (most often) contain a barcode scanner and (less often) generic Android consumer devices. Specifically the Intermec CN51 (API 17) and the Trimble T41 (API 16). In order to properly utilize the scanner you must access the vendor specific libraries. These 2 vendors provide libraries for their respective devices, though a little differently. I am using the standard debug and release buildtypes and have setup flavors for cn51, t41 and generic. A build produces 6 apks.</p>
  
  <p>The T41 SDK is added to via the Android SDK manager -> Addon sites -> User defined. To build for this device you must set the compileSdkVersion in the build.gradle file to:</p>
  
  <pre><code>compileSdkVersion 'Trimble Navigation Limited:Trimble MCS APIs 4.1:16'
  </code></pre>
  
  <p>The CN51 requires the inclusion of the appropriate jar file:</p>
  
  <pre><code>dependencies {
     compile files('libs/DataCollection.jar')
  }
  </code></pre>
  
  <p>My question: is there a clean way build for these 3 different flavors? </p>
  
  <p>Where: </p>
  
  <ol>
  <li>generic does not include the jar and uses the the normal compileSdkVersion </li>
  <li>CN51 include the jar and uses the normal compileSdkVersion </li>
  <li>T41 exclude the jar and uses the Trimble SDK for compiledSdkVersion</li>
  </ol>
  
  <p>I have tried seperate .gradle scripts e.g.: buildt41.gradle and then execute  "gradle -b buildt41.gradle" but was unable to get it to properly build and that does not appear to help when working within studio.</p>