Modify gradle 'classpath' variable with Build Variants

android, android-gradle-plugin, build.gradle

Solution

As mentioned here the Amazon version of the Android Gradle Plugin just extends the standard plugin by adding additional support for compiling XML with SDK addon resources. To date, the corresponding Amazon version of the plugin has been released shortly after the release of the regular Android plugin. So you should have no problem with using the Amazon plugin for both your Amazon and non-Amazon builds since it is fully compatible.

Problem

Is it possible to modify the classpath variable with Build Variants? Example: ``` buildscript { repositories { mavenCentral() } dependencies { ***classpath*** 'com.android.tools.build:gradle:0.12.+' } } apply plugin: 'android' repositories { mavenCentral() mavenLocal() } android { compileSdkVersion 19 buildToolsVersion "20.0.0" defaultConfig { minSdkVersion 14 targetSdkVersion 19 } productFlavors { flavor1 { classpath 'com.android.tools.build:gradle:0.12.+' minSdkVersion 14 targetSdkVersion 19 } flavor2 { classpath 'com.amazon.device.tools.build:gradle:0.9.+' minSdkVersion 17 targetSdkVersion 17 } } } ``` I want too be able to use a different classpath in my buildscripts dependencies, but I assumed the product flavors depeneded on the buildscript to run, which seems circular and hence my question of whether I can actually modify it with product flavors. (There was no mention in the android gradle plugin examples if you could or not)

Original source